From 304b4c2d862a20c18561972b9f2f6d11f9462c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Sun, 14 Oct 2012 01:17:25 -0400 Subject: [PATCH] cmake: fix windows build --- channels/printer/client/CMakeLists.txt | 3 ++- channels/rail/client/CMakeLists.txt | 1 + channels/rdpdr/client/CMakeLists.txt | 2 +- channels/rdpsnd/client/CMakeLists.txt | 1 + channels/rdpsnd/server/CMakeLists.txt | 2 ++ channels/smartcard/client/CMakeLists.txt | 4 +++- libfreerdp/core/settings.c | 5 +++++ winpr/libwinpr/sspi/CMakeLists.txt | 4 ++++ winpr/libwinpr/sspi/module.def | 3 +++ winpr/libwinpr/sysinfo/CMakeLists.txt | 4 ++++ winpr/libwinpr/sysinfo/module.def | 3 +++ 11 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 winpr/libwinpr/sspi/module.def create mode 100644 winpr/libwinpr/sysinfo/module.def diff --git a/channels/printer/client/CMakeLists.txt b/channels/printer/client/CMakeLists.txt index 3e9c0efaa..0d1b53c31 100644 --- a/channels/printer/client/CMakeLists.txt +++ b/channels/printer/client/CMakeLists.txt @@ -52,9 +52,10 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULES winpr-crt winpr-synch winpr-thread winpr-interlocked) if(WITH_CUPS) - target_link_libraries(${MODULE_NAME} ${CUPS_LIBRARIES}) + set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${CUPS_LIBRARIES}) endif() +target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_PLUGIN_PATH}) set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${MODULE_NAME}/Client") diff --git a/channels/rail/client/CMakeLists.txt b/channels/rail/client/CMakeLists.txt index f7e3b139f..1553c94a6 100644 --- a/channels/rail/client/CMakeLists.txt +++ b/channels/rail/client/CMakeLists.txt @@ -39,6 +39,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) +target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_PLUGIN_PATH}) set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${MODULE_NAME}/Client") diff --git a/channels/rdpdr/client/CMakeLists.txt b/channels/rdpdr/client/CMakeLists.txt index d35277b92..ae6adaa2d 100644 --- a/channels/rdpdr/client/CMakeLists.txt +++ b/channels/rdpdr/client/CMakeLists.txt @@ -48,5 +48,5 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE winpr MODULES winpr-crt winpr-synch winpr-thread winpr-interlocked) +target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${MODULE_NAME}/Client") - diff --git a/channels/rdpsnd/client/CMakeLists.txt b/channels/rdpsnd/client/CMakeLists.txt index dfd5b5467..263c44f51 100644 --- a/channels/rdpsnd/client/CMakeLists.txt +++ b/channels/rdpsnd/client/CMakeLists.txt @@ -37,6 +37,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) +target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_PLUGIN_PATH}) set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${MODULE_NAME}/Client") diff --git a/channels/rdpsnd/server/CMakeLists.txt b/channels/rdpsnd/server/CMakeLists.txt index 9c5850ba8..2768d0bd2 100644 --- a/channels/rdpsnd/server/CMakeLists.txt +++ b/channels/rdpsnd/server/CMakeLists.txt @@ -38,4 +38,6 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) +target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) + set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL}/Server") diff --git a/channels/smartcard/client/CMakeLists.txt b/channels/smartcard/client/CMakeLists.txt index 5161b5625..05a0ac101 100644 --- a/channels/smartcard/client/CMakeLists.txt +++ b/channels/smartcard/client/CMakeLists.txt @@ -37,7 +37,9 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE winpr MODULES winpr-crt winpr-synch winpr-thread winpr-interlocked) -target_link_libraries(${MODULE_NAME} ${PCSC_LIBRARIES}) +target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) + +target_link_libraries(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${PCSC_LIBRARIES}) install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_PLUGIN_PATH}) diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index 3cd9b0512..c59615b1f 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -36,6 +36,9 @@ #include #include +#pragma warning(push) +#pragma warning(disable: 4244) + static const char client_dll[] = "C:\\Windows\\System32\\mstscax.dll"; #define REG_QUERY_DWORD_VALUE(_key, _subkey, _type, _value, _size, _result) \ @@ -393,3 +396,5 @@ void settings_free(rdpSettings* settings) free(settings); } } + +#pragma warning(pop) diff --git a/winpr/libwinpr/sspi/CMakeLists.txt b/winpr/libwinpr/sspi/CMakeLists.txt index 36bfda673..f969e0e48 100644 --- a/winpr/libwinpr/sspi/CMakeLists.txt +++ b/winpr/libwinpr/sspi/CMakeLists.txt @@ -53,6 +53,10 @@ if(NOT WITH_NATIVE_SSPI) ${${MODULE_PREFIX}_SRCS}) endif() +if(MSVC AND (NOT MONOLITHIC_BUILD)) + set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) +endif() + add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" MONOLITHIC ${MONOLITHIC_BUILD} SOURCES ${${MODULE_PREFIX}_SRCS}) diff --git a/winpr/libwinpr/sspi/module.def b/winpr/libwinpr/sspi/module.def new file mode 100644 index 000000000..bfb9568ee --- /dev/null +++ b/winpr/libwinpr/sspi/module.def @@ -0,0 +1,3 @@ +LIBRARY "libwinpr-sspi" +EXPORTS + diff --git a/winpr/libwinpr/sysinfo/CMakeLists.txt b/winpr/libwinpr/sysinfo/CMakeLists.txt index 5fbacd66d..c235c754e 100644 --- a/winpr/libwinpr/sysinfo/CMakeLists.txt +++ b/winpr/libwinpr/sysinfo/CMakeLists.txt @@ -21,6 +21,10 @@ set(MODULE_PREFIX "WINPR_SYSINFO") set(${MODULE_PREFIX}_SRCS sysinfo.c) +if(MSVC AND (NOT MONOLITHIC_BUILD)) + set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) +endif() + add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" MONOLITHIC ${MONOLITHIC_BUILD} SOURCES ${${MODULE_PREFIX}_SRCS}) diff --git a/winpr/libwinpr/sysinfo/module.def b/winpr/libwinpr/sysinfo/module.def new file mode 100644 index 000000000..50f4066fc --- /dev/null +++ b/winpr/libwinpr/sysinfo/module.def @@ -0,0 +1,3 @@ +LIBRARY "libwinpr-sysinfo" +EXPORTS +