diff --git a/CMakeLists.txt b/CMakeLists.txt index e05e9d5cb..069b56b41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,6 +96,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) 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++; } 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()