diff options
Diffstat (limited to 'server/proxy')
-rw-r--r-- | server/proxy/CMakeLists.txt | 29 | ||||
-rw-r--r-- | server/proxy/cli/CMakeLists.txt | 35 | ||||
-rw-r--r-- | server/proxy/modules/bitmap-filter/CMakeLists.txt | 6 | ||||
-rw-r--r-- | server/proxy/modules/demo/CMakeLists.txt | 6 | ||||
-rw-r--r-- | server/proxy/modules/dyn-channel-dump/CMakeLists.txt | 6 | ||||
-rw-r--r-- | server/proxy/pf_server.c | 15 |
6 files changed, 18 insertions, 79 deletions
diff --git a/server/proxy/CMakeLists.txt b/server/proxy/CMakeLists.txt index 4693b17..8a262dd 100644 --- a/server/proxy/CMakeLists.txt +++ b/server/proxy/CMakeLists.txt @@ -47,29 +47,7 @@ set(PROXY_APP_SRCS freerdp_proxy.c) option(WITH_PROXY_EMULATE_SMARTCARD "Compile proxy smartcard emulation" OFF) add_subdirectory("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 "${MODULE_NAME}${CMAKE_EXECUTABLE_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) - list(APPEND PROXY_APP_SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc) -endif() - -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() +AddTargetWithResourceFile(${MODULE_NAME} FALSE "${FREERDP_VERSION}" ${MODULE_PREFIX}_SRCS) set(PRIVATE_LIBS freerdp-client @@ -89,11 +67,6 @@ install(TARGETS ${MODULE_NAME} COMPONENT server EXPORT FreeRDP-ProxyTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS) - get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME) - install(FILES ${CMAKE_PDB_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols) -endif() - set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Proxy") # pkg-config diff --git a/server/proxy/cli/CMakeLists.txt b/server/proxy/cli/CMakeLists.txt index 1416b4a..a532f90 100644 --- a/server/proxy/cli/CMakeLists.txt +++ b/server/proxy/cli/CMakeLists.txt @@ -18,43 +18,12 @@ set(PROXY_APP_SRCS freerdp_proxy.c) -# 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 "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" ) - - configure_file( - ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in - ${CMAKE_CURRENT_BINARY_DIR}/version.rc - @ONLY) - - list(APPEND PROXY_APP_SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc) -endif() - set(APP_NAME "freerdp-proxy") -add_executable(${APP_NAME} - ${PROXY_APP_SRCS} -) - -set(MANPAGE_NAME ${APP_NAME}.1) -if (WITH_BINARY_VERSIONING) - set_target_properties(${APP_NAME} - PROPERTIES - OUTPUT_NAME "${APP_NAME}${FREERDP_API_VERSION}" - ) - set(MANPAGE_NAME ${APP_NAME}${FREERDP_API_VERSION}.1) -endif() +AddTargetWithResourceFile(${APP_NAME} TRUE "${FREERDP_VERSION}" PROXY_APP_SRCS) target_link_libraries(${APP_NAME} ${MODULE_NAME}) install(TARGETS ${APP_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server) -if (WITH_DEBUG_SYMBOLS AND MSVC) - install(FILES ${CMAKE_PDB_BINARY_DIR}/${APP_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols) -endif() set_property(TARGET ${APP_NAME} PROPERTY FOLDER "Server/proxy") -configure_file(${APP_NAME}.1.in ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}) -install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME} 1) +generate_and_install_freerdp_man_from_template(${APP_NAME} "1" "${FREERDP_API_VERSION}") diff --git a/server/proxy/modules/bitmap-filter/CMakeLists.txt b/server/proxy/modules/bitmap-filter/CMakeLists.txt index d2cc03b..e51853f 100644 --- a/server/proxy/modules/bitmap-filter/CMakeLists.txt +++ b/server/proxy/modules/bitmap-filter/CMakeLists.txt @@ -48,13 +48,11 @@ include(CommonConfigOptions) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -add_library(${PROJECT_NAME} SHARED +set(SRCS bitmap-filter.cpp ) +AddTargetWithResourceFile(${PROJECT_NAME} FALSE "${PROJECT_VERSION}" SRCS FALSE) target_link_libraries(${PROJECT_NAME} winpr freerdp) -set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") -set_target_properties(${PROJECT_NAME} PROPERTIES NO_SONAME 1) - install(TARGETS ${PROJECT_NAME} DESTINATION ${FREERDP_PROXY_PLUGINDIR}) diff --git a/server/proxy/modules/demo/CMakeLists.txt b/server/proxy/modules/demo/CMakeLists.txt index bdd85a3..ba1382b 100644 --- a/server/proxy/modules/demo/CMakeLists.txt +++ b/server/proxy/modules/demo/CMakeLists.txt @@ -41,13 +41,11 @@ include(CommonConfigOptions) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -add_library(${PROJECT_NAME} SHARED +set(SRCS demo.cpp ) +AddTargetWithResourceFile(${PROJECT_NAME} FALSE "${PROJECT_VERSION}" SRCS FALSE) target_link_libraries(${PROJECT_NAME} winpr) -set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") -set_target_properties(${PROJECT_NAME} PROPERTIES NO_SONAME 1) - install(TARGETS ${PROJECT_NAME} DESTINATION ${FREERDP_PROXY_PLUGINDIR}) diff --git a/server/proxy/modules/dyn-channel-dump/CMakeLists.txt b/server/proxy/modules/dyn-channel-dump/CMakeLists.txt index dc0fc53..dff349c 100644 --- a/server/proxy/modules/dyn-channel-dump/CMakeLists.txt +++ b/server/proxy/modules/dyn-channel-dump/CMakeLists.txt @@ -40,9 +40,10 @@ include(CommonConfigOptions) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -add_library(${PROJECT_NAME} SHARED +set(SRCS dyn-channel-dump.cpp ) +AddTargetWithResourceFile(${PROJECT_NAME} FALSE "${PROJECT_VERSION}" SRCS FALSE) target_link_libraries(${PROJECT_NAME} PRIVATE winpr @@ -52,7 +53,4 @@ target_link_libraries(${PROJECT_NAME} PRIVATE freerdp-server-proxy ) -set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") -set_target_properties(${PROJECT_NAME} PROPERTIES NO_SONAME 1) - install(TARGETS ${PROJECT_NAME} DESTINATION ${FREERDP_PROXY_PLUGINDIR}) diff --git a/server/proxy/pf_server.c b/server/proxy/pf_server.c index 545ab93..5a4828b 100644 --- a/server/proxy/pf_server.c +++ b/server/proxy/pf_server.c @@ -190,6 +190,7 @@ static BOOL pf_server_get_target_info(rdpContext* context, rdpSettings* settings static BOOL pf_server_setup_channels(freerdp_peer* peer) { + BOOL rc = FALSE; char** accepted_channels = NULL; size_t accepted_channels_count = 0; pServerContext* ps = (pServerContext*)peer->context; @@ -209,7 +210,7 @@ static BOOL pf_server_setup_channels(freerdp_peer* peer) if (!channelContext) { PROXY_LOG_ERR(TAG, ps, "error seting up channelContext for '%s'", cname); - return FALSE; + goto fail; } if (strcmp(cname, DRDYNVC_SVC_CHANNEL_NAME) == 0) @@ -218,7 +219,7 @@ static BOOL pf_server_setup_channels(freerdp_peer* peer) { PROXY_LOG_ERR(TAG, ps, "error while setting up dynamic channel"); StaticChannelContext_free(channelContext); - return FALSE; + goto fail; } } else if (strcmp(cname, RDPDR_SVC_CHANNEL_NAME) == 0 && @@ -228,7 +229,7 @@ static BOOL pf_server_setup_channels(freerdp_peer* peer) { PROXY_LOG_ERR(TAG, ps, "error while setting up redirection channel"); StaticChannelContext_free(channelContext); - return FALSE; + goto fail; } } else @@ -237,7 +238,7 @@ static BOOL pf_server_setup_channels(freerdp_peer* peer) { PROXY_LOG_ERR(TAG, ps, "error while setting up generic channel"); StaticChannelContext_free(channelContext); - return FALSE; + goto fail; } } @@ -246,12 +247,14 @@ static BOOL pf_server_setup_channels(freerdp_peer* peer) { StaticChannelContext_free(channelContext); PROXY_LOG_ERR(TAG, ps, "error inserting channelContext in byId table for '%s'", cname); - return FALSE; + goto fail; } } + rc = TRUE; +fail: free(accepted_channels); - return TRUE; + return rc; } /* Event callbacks */ |