Skip to content

Commit

Permalink
Removed BUILTIN_CHANNELS
Browse files Browse the repository at this point in the history
Building client channels out of tree does not work reliable as the
dependencies can not be easily split. (exceptions may be simple ones
as echo channel)
It does complicate the build system and code though, so remove this
for maintainability reasons.
  • Loading branch information
akallabeth committed Feb 23, 2022
1 parent 538b34c commit fd027d1
Show file tree
Hide file tree
Showing 71 changed files with 69 additions and 496 deletions.
8 changes: 1 addition & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ if (WITH_FREERDP_DEPRECATED)
add_definitions(-DWITH_FREERDP_DEPRECATED)
endif()

# Compatibility options
if(DEFINED STATIC_CHANNELS)
message(WARNING "STATIC_CHANNELS is obsolete, please use BUILTIN_CHANNELS instead")
set(BUILTIN_CHANNELS ${STATIC_CHANNELS} CACHE BOOL "" FORCE)
endif()

# Make paths absolute
if (CMAKE_INSTALL_PREFIX)
get_filename_component(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
Expand Down Expand Up @@ -1004,7 +998,7 @@ include(${CMAKE_CPACK_INCLUDE_FILE})
set(FREERDP_BUILD_CONFIG_LIST "")
GET_CMAKE_PROPERTY(res VARIABLES)
FOREACH(var ${res})
IF (var MATCHES "^WITH_*|^BUILD_TESTING|^BUILTIN_CHANNELS|^HAVE_*")
IF (var MATCHES "^WITH_*|^BUILD_TESTING|^HAVE_*")
LIST(APPEND FREERDP_BUILD_CONFIG_LIST "${var}=${${var}}")
ENDIF()
ENDFOREACH()
Expand Down
117 changes: 25 additions & 92 deletions channels/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ macro(add_channel_client_subsystem _channel_prefix _channel_name _subsystem _typ
endmacro(add_channel_client_subsystem)

macro(channel_install _targets _destination _export_target)
if (NOT BUILTIN_CHANNELS OR NOT BUILD_SHARED_LIBS)
if (NOT BUILD_SHARED_LIBS)
install(TARGETS ${_targets} DESTINATION ${_destination} EXPORT ${_export_target})
endif()
endmacro(channel_install)
Expand All @@ -182,39 +182,16 @@ macro(add_channel_client_library _module_prefix _module_name _channel_name _dyna
link_directories(${_lnk_dir})
endif()

if(${_dynamic} AND (NOT BUILTIN_CHANNELS))
# On windows create dll version information.
# Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32)
set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
set (RC_VERSION_PATCH 0)
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${_module_name}${CMAKE_SHARED_LIBRARY_SUFFIX}" )

configure_file(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)

set ( ${_module_prefix}_SRCS ${${_module_prefix}_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
set(${_module_prefix}_STATIC ON PARENT_SCOPE)
set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE)
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})

add_library(${_module_name} ${${_module_prefix}_SRCS})
target_link_libraries(${_module_name} ${${_module_prefix}_LIBS})
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
else()
set(${_module_prefix}_STATIC ON PARENT_SCOPE)
set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE)
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 (NOT BUILD_SHARED_LIBS)
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
endif()
endif()
if (NOT BUILD_SHARED_LIBS)
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
endif()
endmacro(add_channel_client_library)

macro(add_channel_client_subsystem_library _module_prefix _module_name _channel_name _type _dynamic _entry)
Expand All @@ -223,38 +200,15 @@ macro(add_channel_client_subsystem_library _module_prefix _module_name _channel_
link_directories(${_lnk_dir})
endif()

if(${_dynamic} AND (NOT BUILTIN_CHANNELS))
# On windows create dll version information.
# Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32)
set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
set (RC_VERSION_PATCH 0)
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${_module_name}${CMAKE_SHARED_LIBRARY_SUFFIX}" )

configure_file(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)

set ( ${_module_prefix}_SRCS ${${_module_prefix}_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()

add_library(${_module_name} ${${_module_prefix}_SRCS})
target_link_libraries(${_module_name} ${${_module_prefix}_LIBS})
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
else()
set(${_module_prefix}_STATIC ON PARENT_SCOPE)
set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE)
set(${_module_prefix}_TYPE ${_type} PARENT_SCOPE)
set(${_module_prefix}_STATIC ON PARENT_SCOPE)
set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE)
set(${_module_prefix}_TYPE ${_type} PARENT_SCOPE)

add_library(${_module_name} STATIC ${${_module_prefix}_SRCS})
target_link_libraries(${_module_name} ${${_module_prefix}_LIBS})
if (NOT BUILD_SHARED_LIBS)
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
endif()
endif()
add_library(${_module_name} STATIC ${${_module_prefix}_SRCS})
target_link_libraries(${_module_name} ${${_module_prefix}_LIBS})
if (NOT BUILD_SHARED_LIBS)
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
endif()
endmacro(add_channel_client_subsystem_library)

macro(add_channel_server_library _module_prefix _module_name _channel_name _dynamic _entry)
Expand All @@ -263,34 +217,13 @@ macro(add_channel_server_library _module_prefix _module_name _channel_name _dyna
link_directories(${_lnk_dir})
endif()

if(${_dynamic} AND (NOT BUILTIN_CHANNELS))
# On windows create dll version information.
# Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32)
set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${_module_name}${FREERDP_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}" )

configure_file(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)

set ( ${_module_prefix}_SRCS ${${_module_prefix}_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()

add_library(${_module_name} ${${_module_prefix}_SRCS})
server_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
else()
set(${_module_prefix}_STATIC ON PARENT_SCOPE)
set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE)
set(${_module_prefix}_CHANNEL ${_channel_name} PARENT_SCOPE)
set(${_module_prefix}_ENTRY ${_entry} PARENT_SCOPE)
add_library(${_module_name} STATIC ${${_module_prefix}_SRCS})
if (NOT BUILD_SHARED_LIBS)
server_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
endif()
set(${_module_prefix}_STATIC ON PARENT_SCOPE)
set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE)
set(${_module_prefix}_CHANNEL ${_channel_name} PARENT_SCOPE)
set(${_module_prefix}_ENTRY ${_entry} PARENT_SCOPE)
add_library(${_module_name} STATIC ${${_module_prefix}_SRCS})
if (NOT BUILD_SHARED_LIBS)
server_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
endif()
endmacro(add_channel_server_library)

Expand Down
2 changes: 1 addition & 1 deletion channels/ainput/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ include_directories(..)

add_channel_client_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} TRUE "DVCPluginEntry")

if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS)
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols)
endif()

Expand Down
8 changes: 1 addition & 7 deletions channels/ainput/client/ainput_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,18 +269,12 @@ static UINT ainput_plugin_terminated(IWTSPlugin* pPlugin)
return CHANNEL_RC_OK;
}

#ifdef BUILTIN_CHANNELS
#define DVCPluginEntry ainput_DVCPluginEntry
#else
#define DVCPluginEntry FREERDP_API DVCPluginEntry
#endif

/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
UINT ainput_DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
{
UINT status = CHANNEL_RC_OK;
AINPUT_PLUGIN* ainput = (AINPUT_PLUGIN*)pEntryPoints->GetPlugin(pEntryPoints, "ainput");
Expand Down
4 changes: 0 additions & 4 deletions channels/audin/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ add_channel_client_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} TRUE

target_link_libraries(${MODULE_NAME} freerdp winpr)

if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS)
install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols)
endif()

set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client")

if(WITH_OSS)
Expand Down
8 changes: 1 addition & 7 deletions channels/audin/client/alsa/audin_alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,18 +390,12 @@ static UINT audin_alsa_parse_addin_args(AudinALSADevice* device, const ADDIN_ARG
return CHANNEL_RC_OK;
}

#ifdef BUILTIN_CHANNELS
#define freerdp_audin_client_subsystem_entry alsa_freerdp_audin_client_subsystem_entry
#else
#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry
#endif

/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
UINT alsa_freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
{
const ADDIN_ARGV* args;
AudinALSADevice* alsa;
Expand Down
8 changes: 1 addition & 7 deletions channels/audin/client/audin_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -953,18 +953,12 @@ BOOL audin_process_addin_args(AUDIN_PLUGIN* audin, const ADDIN_ARGV* args)
return TRUE;
}

#ifdef BUILTIN_CHANNELS
#define DVCPluginEntry audin_DVCPluginEntry
#else
#define DVCPluginEntry FREERDP_API DVCPluginEntry
#endif

/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
UINT audin_DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
{
struct SubsystemEntry
{
Expand Down
8 changes: 1 addition & 7 deletions channels/audin/client/ios/audin_ios.m
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,7 @@ static UINT audin_ios_free(IAudinDevice *device)
return CHANNEL_RC_OK;
}

#ifdef BUILTIN_CHANNELS
#define freerdp_audin_client_subsystem_entry ios_freerdp_audin_client_subsystem_entry
#else
#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry
#endif

UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
UINT ios_freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
{
DWORD errCode;
char errString[1024];
Expand Down
8 changes: 1 addition & 7 deletions channels/audin/client/mac/audin_mac.m
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,7 @@ static UINT audin_mac_parse_addin_args(AudinMacDevice *device, const ADDIN_ARGV
return CHANNEL_RC_OK;
}

#ifdef BUILTIN_CHANNELS
#define freerdp_audin_client_subsystem_entry mac_freerdp_audin_client_subsystem_entry
#else
#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry
#endif

UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
UINT mac_freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
{
DWORD errCode;
char errString[1024];
Expand Down
8 changes: 1 addition & 7 deletions channels/audin/client/opensles/audin_opensl_es.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,18 +288,12 @@ static UINT audin_opensles_parse_addin_args(AudinOpenSLESDevice* device, const A
return CHANNEL_RC_OK;
}

#ifdef BUILTIN_CHANNELS
#define freerdp_audin_client_subsystem_entry opensles_freerdp_audin_client_subsystem_entry
#else
#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry
#endif

/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
UINT opensles_freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
{
const ADDIN_ARGV* args;
AudinOpenSLESDevice* opensles;
Expand Down
8 changes: 1 addition & 7 deletions channels/audin/client/oss/audin_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,18 +443,12 @@ static UINT audin_oss_parse_addin_args(AudinOSSDevice* device, const ADDIN_ARGV*
return CHANNEL_RC_OK;
}

#ifdef BUILTIN_CHANNELS
#define freerdp_audin_client_subsystem_entry oss_freerdp_audin_client_subsystem_entry
#else
#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry
#endif

/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
UINT oss_freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
{
const ADDIN_ARGV* args;
AudinOSSDevice* oss;
Expand Down
8 changes: 1 addition & 7 deletions channels/audin/client/pulse/audin_pulse.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,18 +505,12 @@ static UINT audin_pulse_parse_addin_args(AudinPulseDevice* device, const ADDIN_A
return CHANNEL_RC_OK;
}

#ifdef BUILTIN_CHANNELS
#define freerdp_audin_client_subsystem_entry pulse_freerdp_audin_client_subsystem_entry
#else
#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry
#endif

/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
UINT pulse_freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
{
const ADDIN_ARGV* args;
AudinPulseDevice* pulse;
Expand Down
8 changes: 1 addition & 7 deletions channels/audin/client/sndio/audin_sndio.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,18 +305,12 @@ static UINT audin_sndio_parse_addin_args(AudinSndioDevice* device, ADDIN_ARGV* a
return CHANNEL_RC_OK;
}

#ifdef BUILTIN_CHANNELS
#define freerdp_audin_client_subsystem_entry sndio_freerdp_audin_client_subsystem_entry
#else
#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry
#endif

/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
UINT sndio_freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
{
ADDIN_ARGV* args;
AudinSndioDevice* sndio;
Expand Down
5 changes: 0 additions & 5 deletions channels/audin/client/winmm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,4 @@ set(${MODULE_PREFIX}_LIBS freerdp winpr winmm.lib)

target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})


if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS)
install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols)
endif()

set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client/winmm")
8 changes: 1 addition & 7 deletions channels/audin/client/winmm/audin_winmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,18 +491,12 @@ static UINT audin_winmm_parse_addin_args(AudinWinmmDevice* device, const ADDIN_A
return CHANNEL_RC_OK;
}

#ifdef BUILTIN_CHANNELS
#define freerdp_audin_client_subsystem_entry winmm_freerdp_audin_client_subsystem_entry
#else
#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry
#endif

/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
UINT winmm_freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints)
{
const ADDIN_ARGV* args;
AudinWinmmDevice* winmm;
Expand Down
5 changes: 0 additions & 5 deletions channels/disp/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,4 @@ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr)

target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})


if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS)
install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols)
endif()

set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client")
Loading

0 comments on commit fd027d1

Please sign in to comment.