From ddf495a79f252a8e77cbc361b6ed166e8b00309f Mon Sep 17 00:00:00 2001 From: Vic Lee Date: Thu, 11 Oct 2012 01:05:37 +0800 Subject: [PATCH 1/3] cmake: fix some linking error on Windows. --- libfreerdp/core/CMakeLists.txt | 4 +++- winpr/libwinpr/pipe/CMakeLists.txt | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libfreerdp/core/CMakeLists.txt b/libfreerdp/core/CMakeLists.txt index d1187517d..7edd20cdb 100644 --- a/libfreerdp/core/CMakeLists.txt +++ b/libfreerdp/core/CMakeLists.txt @@ -104,10 +104,12 @@ if(MONOLITHIC_BUILD) set(${MODULE_PREFIX}_LIBS winpr) else() set(${MODULE_PREFIX}_LIBS - winpr-registry winpr-utils winpr-sspi winpr-crt) + if (NOT WIN32) + set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr-registry) + endif() endif() if(WIN32) diff --git a/winpr/libwinpr/pipe/CMakeLists.txt b/winpr/libwinpr/pipe/CMakeLists.txt index 034abbee6..1f68429da 100644 --- a/winpr/libwinpr/pipe/CMakeLists.txt +++ b/winpr/libwinpr/pipe/CMakeLists.txt @@ -36,7 +36,13 @@ set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SO if(MONOLITHIC_BUILD) else() - target_link_libraries(${MODULE_NAME} winpr-crt winpr-file winpr-handle) + set(${MODULE_PREFIX}_LIBS + winpr-crt + winpr-handle) + if (NOT WIN32) + set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr-file) + endif() + target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() From 8b70615b30f4a3b5c20df20dbadf7a8199e2e54a Mon Sep 17 00:00:00 2001 From: Jean-Louis Dupond Date: Thu, 11 Oct 2012 00:07:56 +0200 Subject: [PATCH 2/3] libfreerdp-codec: return ARGB32/ABGR32 for dstBpp 32 with alpha --- libfreerdp/codec/color.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/libfreerdp/codec/color.c b/libfreerdp/codec/color.c index 42aa4e5e7..cf65680b6 100644 --- a/libfreerdp/codec/color.c +++ b/libfreerdp/codec/color.c @@ -426,7 +426,14 @@ BYTE* freerdp_image_convert_8bpp(BYTE* srcData, BYTE* dstData, int width, int he red = clrconv->palette->entries[pixel].red; green = clrconv->palette->entries[pixel].green; blue = clrconv->palette->entries[pixel].blue; - pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue); + if (clrconv->alpha) + { + pixel = (clrconv->invert) ? ARGB32(0xFF, red, green, blue) : ABGR32(0xFF, red, green, blue); + } + else + { + pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue); + } *dst32 = pixel; dst32++; } @@ -468,7 +475,14 @@ BYTE* freerdp_image_convert_15bpp(BYTE* srcData, BYTE* dstData, int width, int h pixel = *src16; src16++; GetBGR15(red, green, blue, pixel); - pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue); + if (clrconv->alpha) + { + pixel = (clrconv->invert) ? ARGB32(0xFF, red, green, blue) : ABGR32(0xFF, red, green, blue); + } + else + { + pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue); + } *dst32 = pixel; dst32++; } @@ -582,7 +596,14 @@ BYTE* freerdp_image_convert_16bpp(BYTE* srcData, BYTE* dstData, int width, int h pixel = *src16; src16++; GetBGR16(red, green, blue, pixel); - pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue); + if (clrconv->alpha) + { + pixel = (clrconv->invert) ? ARGB32(0xFF, red, green, blue) : ABGR32(0xFF, red, green, blue); + } + else + { + pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue); + } *dst32 = pixel; dst32++; } From cebea5590af89b0eaa0818d7ac241efd3937a273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Thu, 11 Oct 2012 08:30:04 -0400 Subject: [PATCH 3/3] cmake: fix for fPIC in CMake 2.8.8- --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24bb41129..912380b7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,6 +100,9 @@ if(CMAKE_COMPILER_IS_GNUCC) if(WITH_SSE2_TARGET) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") endif() + if(${CMAKE_VERSION} VERSION_LESS 2.8.8) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + endif() endif() if(MSVC)