From 0307482506ddc4dacc51ff9b5ea37f2545ad0a3c Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 20 Feb 2023 10:03:03 +0100 Subject: [PATCH] [channels,rdpsnd] add rdpsnd-common object lib --- channels/CMakeLists.txt | 9 ++++++++- channels/rdpsnd/client/CMakeLists.txt | 2 +- channels/rdpsnd/common/CMakeLists.txt | 4 +++- channels/rdpsnd/common/rdpsnd_common.c | 21 +++++++++++++++++++++ channels/rdpsnd/server/CMakeLists.txt | 4 ++++ channels/urbdrc/common/CMakeLists.txt | 2 ++ 6 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 channels/rdpsnd/common/rdpsnd_common.c diff --git a/channels/CMakeLists.txt b/channels/CMakeLists.txt index c52e7da34..1bfc1a2c5 100644 --- a/channels/CMakeLists.txt +++ b/channels/CMakeLists.txt @@ -187,7 +187,10 @@ 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} STATIC ${${_module_prefix}_SRCS}) - target_link_libraries(${_module_name} ${${_module_prefix}_LIBS}) + + if (${${_module_prefix}_LIBS}) + target_link_libraries(${_module_name} PRIVATE ${${_module_prefix}_LIBS}) + endif() if (NOT BUILD_SHARED_LIBS) client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) @@ -222,6 +225,10 @@ 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} STATIC ${${_module_prefix}_SRCS}) + + if (${${_module_prefix}_LIBS}) + target_link_libraries(${_module_name} PRIVATE ${${_module_prefix}_LIBS}) + endif() if (NOT BUILD_SHARED_LIBS) server_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) endif() diff --git a/channels/rdpsnd/client/CMakeLists.txt b/channels/rdpsnd/client/CMakeLists.txt index 7a3ee2ccb..700bdfd74 100644 --- a/channels/rdpsnd/client/CMakeLists.txt +++ b/channels/rdpsnd/client/CMakeLists.txt @@ -24,7 +24,7 @@ set(${MODULE_PREFIX}_SRCS add_channel_client_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} FALSE "VirtualChannelEntryEx;DVCPluginEntry") target_link_libraries(${MODULE_NAME} - winpr freerdp ${CMAKE_THREAD_LIBS_INIT} + winpr freerdp ${CMAKE_THREAD_LIBS_INIT} rdpsnd-common ) set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/channels/rdpsnd/common/CMakeLists.txt b/channels/rdpsnd/common/CMakeLists.txt index 32fa91823..0f151ca2e 100644 --- a/channels/rdpsnd/common/CMakeLists.txt +++ b/channels/rdpsnd/common/CMakeLists.txt @@ -21,4 +21,6 @@ set(SRCS rdpsnd_common.c) # Library currently header only -#add_library(rdpsnd-common STATIC ${SRCS}) +add_library(rdpsnd-common OBJECT ${SRCS}) +set_property(TARGET rdpsnd-common PROPERTY POSITION_INDEPENDENT_CODE ON) + diff --git a/channels/rdpsnd/common/rdpsnd_common.c b/channels/rdpsnd/common/rdpsnd_common.c new file mode 100644 index 000000000..a420beb96 --- /dev/null +++ b/channels/rdpsnd/common/rdpsnd_common.c @@ -0,0 +1,21 @@ +/** + * FreeRDP: A Remote Desktop Protocol Implementation + * Server Audio Virtual Channel + * + * Copyright 2018 Armin Novak + * Copyright 2018 Thincast Technologies GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "rdpsnd_common.h" diff --git a/channels/rdpsnd/server/CMakeLists.txt b/channels/rdpsnd/server/CMakeLists.txt index 9df47f2f6..8a8ba3ef2 100644 --- a/channels/rdpsnd/server/CMakeLists.txt +++ b/channels/rdpsnd/server/CMakeLists.txt @@ -21,6 +21,10 @@ set(${MODULE_PREFIX}_SRCS rdpsnd_main.c rdpsnd_main.h) +set(${MODULE_PREFIX}_LIBS + rdpsnd-common +) + add_channel_server_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} FALSE "VirtualChannelEntry") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Server") diff --git a/channels/urbdrc/common/CMakeLists.txt b/channels/urbdrc/common/CMakeLists.txt index 0e7b448be..e816c8cd1 100644 --- a/channels/urbdrc/common/CMakeLists.txt +++ b/channels/urbdrc/common/CMakeLists.txt @@ -24,3 +24,5 @@ set(SRCS msusb.c) add_library(urbdrc-common OBJECT ${SRCS}) +set_property(TARGET urbdrc-common PROPERTY POSITION_INDEPENDENT_CODE ON) +