From 273bb6a7a805585bb07457a9efc67d4f3e4fc543 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 20 Feb 2023 14:00:41 +0100 Subject: [PATCH] [build] use static libraries as intermediate --- channels/CMakeLists.txt | 7 ++----- channels/rdpsnd/common/CMakeLists.txt | 3 +-- channels/urbdrc/client/CMakeLists.txt | 2 +- channels/urbdrc/common/CMakeLists.txt | 3 +-- client/CMakeLists.txt | 2 +- server/CMakeLists.txt | 2 +- server/proxy/CMakeLists.txt | 14 +++++++++----- server/proxy/channels/CMakeLists.txt | 2 +- server/shadow/CMakeLists.txt | 2 +- 9 files changed, 18 insertions(+), 19 deletions(-) diff --git a/channels/CMakeLists.txt b/channels/CMakeLists.txt index f5fd3dd25..3a65dea91 100644 --- a/channels/CMakeLists.txt +++ b/channels/CMakeLists.txt @@ -173,8 +173,7 @@ macro(add_channel_client_library _module_prefix _module_name _channel_name _dyna set(${_module_prefix}_CHANNEL ${_channel_name} PARENT_SCOPE) set(${_module_prefix}_ENTRY ${_entry} PARENT_SCOPE) - add_library(${_module_name} OBJECT ${${_module_prefix}_SRCS}) - set_property(TARGET ${_module_name} PROPERTY POSITION_INDEPENDENT_CODE ON) + add_library(${_module_name} STATIC ${${_module_prefix}_SRCS}) set_property(TARGET ${_module_name} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") if (${_module_prefix}_LIBS) @@ -193,7 +192,6 @@ macro(add_channel_client_subsystem_library _module_prefix _module_name _channel_ set(${_module_prefix}_TYPE ${_type} PARENT_SCOPE) add_library(${_module_name} STATIC ${${_module_prefix}_SRCS}) - set_property(TARGET ${_module_name} PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET ${_module_name} PROPERTY FOLDER "Channels/${_channel_name}/Client/Subsystem/${CHANNEL_SUBSYSTEM}") if (${_module_prefix}_LIBS) @@ -212,8 +210,7 @@ macro(add_channel_server_library _module_prefix _module_name _channel_name _dyna set(${_module_prefix}_CHANNEL ${_channel_name} PARENT_SCOPE) set(${_module_prefix}_ENTRY ${_entry} PARENT_SCOPE) - add_library(${_module_name} OBJECT ${${_module_prefix}_SRCS}) - set_property(TARGET ${_module_name} PROPERTY POSITION_INDEPENDENT_CODE ON) + add_library(${_module_name} STATIC ${${_module_prefix}_SRCS}) set_property(TARGET ${_module_name} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Server") if (${_module_prefix}_LIBS) diff --git a/channels/rdpsnd/common/CMakeLists.txt b/channels/rdpsnd/common/CMakeLists.txt index 0f151ca2e..7725c7c91 100644 --- a/channels/rdpsnd/common/CMakeLists.txt +++ b/channels/rdpsnd/common/CMakeLists.txt @@ -21,6 +21,5 @@ set(SRCS rdpsnd_common.c) # Library currently header only -add_library(rdpsnd-common OBJECT ${SRCS}) -set_property(TARGET rdpsnd-common PROPERTY POSITION_INDEPENDENT_CODE ON) +add_library(rdpsnd-common STATIC ${SRCS}) diff --git a/channels/urbdrc/client/CMakeLists.txt b/channels/urbdrc/client/CMakeLists.txt index a8d7acc8a..0e1f89ad2 100644 --- a/channels/urbdrc/client/CMakeLists.txt +++ b/channels/urbdrc/client/CMakeLists.txt @@ -27,7 +27,7 @@ set(${MODULE_PREFIX}_SRCS set(${MODULE_PREFIX}_LIBS winpr freerdp - $ + urbdrc-common ) if (UDEV_FOUND AND UDEV_LIBRARIES) list(APPEND ${MODULE_PREFIX}_LIBS ${UDEV_LIBRARIES}) diff --git a/channels/urbdrc/common/CMakeLists.txt b/channels/urbdrc/common/CMakeLists.txt index e816c8cd1..5fba55c0c 100644 --- a/channels/urbdrc/common/CMakeLists.txt +++ b/channels/urbdrc/common/CMakeLists.txt @@ -23,6 +23,5 @@ set(SRCS msusb.h msusb.c) -add_library(urbdrc-common OBJECT ${SRCS}) -set_property(TARGET urbdrc-common PROPERTY POSITION_INDEPENDENT_CODE ON) +add_library(urbdrc-common STATIC ${SRCS}) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index e43b706f4..36bb2b8bc 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -107,6 +107,6 @@ write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ClientConfi install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ClientConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ClientConfigVersion.cmake DESTINATION ${FREERDP_CLIENT_CMAKE_INSTALL_DIR}) -if (CMAKE_BUILD_SHARED) +if (CMAKE_BUILD_SHARED_LIBS) install(EXPORT FreeRDP-ClientTargets DESTINATION ${FREERDP_CLIENT_CMAKE_INSTALL_DIR}) endif() diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 45952c2d8..02770ca1f 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -90,6 +90,6 @@ write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfi install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfigVersion.cmake DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR}) -if (CMAKE_BUILD_SHARED) +if (CMAKE_BUILD_SHARED_LIBS) install(EXPORT FreeRDP-ServerTargets DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR}) endif() diff --git a/server/proxy/CMakeLists.txt b/server/proxy/CMakeLists.txt index 3a23835ab..10875811d 100644 --- a/server/proxy/CMakeLists.txt +++ b/server/proxy/CMakeLists.txt @@ -63,16 +63,20 @@ if (WIN32) list(APPEND PROXY_APP_SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc) endif() -add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS} $) +add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION}) if (WITH_LIBRARY_VERSIONING) set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION}) endif() -set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-server) -set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-client) -set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr freerdp) +set(${MODULE_PREFIX}_LIBS + winpr + freerdp + freerdp-client + freerdp-server + pf_channels +) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT server EXPORT FreeRDP-ProxyTargets) @@ -96,7 +100,7 @@ write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ProxyConfig install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ProxyConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ProxyConfigVersion.cmake DESTINATION ${FREERDP_PROXY_CMAKE_INSTALL_DIR}) -if (CMAKE_BUILD_SHARED) +if (CMAKE_BUILD_SHARED_LIBS) install(EXPORT FreeRDP-ProxyTargets DESTINATION ${FREERDP_PROXY_CMAKE_INSTALL_DIR}) endif() diff --git a/server/proxy/channels/CMakeLists.txt b/server/proxy/channels/CMakeLists.txt index 1915d83d2..2912d1ff2 100644 --- a/server/proxy/channels/CMakeLists.txt +++ b/server/proxy/channels/CMakeLists.txt @@ -14,4 +14,4 @@ if (WITH_PROXY_EMULATE_SMARTCARD) ) endif() -add_library(${MODULE_NAME} OBJECT ${SOURCES}) +add_library(${MODULE_NAME} STATIC ${SOURCES}) diff --git a/server/shadow/CMakeLists.txt b/server/shadow/CMakeLists.txt index e7fcbd52d..8cb750305 100644 --- a/server/shadow/CMakeLists.txt +++ b/server/shadow/CMakeLists.txt @@ -377,6 +377,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ShadowConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ShadowConfigVersion.cmake DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR}) -if (CMAKE_BUILD_SHARED) +if (CMAKE_BUILD_SHARED_LIBS) install(EXPORT FreeRDP-ShadowTargets DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR}) endif()