diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d94a63c1..446e685a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,6 +170,8 @@ set(FREERDP_KEYMAP_PATH "${FREERDP_DATA_PATH}/keymaps") # Path to put plugins set(FREERDP_PLUGIN_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/freerdp") +set(FREERDP_CLIENT_PLUGIN_PATH "${FREERDP_PLUGIN_PATH}/client") +set(FREERDP_SERVER_PLUGIN_PATH "${FREERDP_PLUGIN_PATH}/server") # Path to put extensions set(FREERDP_EXTENSION_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/freerdp/extensions") diff --git a/channels/CMakeLists.txt b/channels/CMakeLists.txt index 3ecbbd569..9c456090e 100644 --- a/channels/CMakeLists.txt +++ b/channels/CMakeLists.txt @@ -30,5 +30,7 @@ foreach(FILEPATH ${FILEPATHS}) endif() endforeach(FILEPATH) -add_subdirectory(server) +if(WITH_SERVER_CHANNELS) + add_subdirectory(server) +endif() diff --git a/channels/audin/CMakeLists.txt b/channels/audin/CMakeLists.txt index 45849a4e0..dc9f2b019 100644 --- a/channels/audin/CMakeLists.txt +++ b/channels/audin/CMakeLists.txt @@ -18,12 +18,14 @@ set(MODULE_NAME "audin") set(MODULE_PREFIX "CHANNEL_AUDIN") -add_subdirectory(client) - -add_subdirectory(server) - -set(${MODULE_PREFIX}_SERVER_SRCS ${${MODULE_PREFIX}_SERVER_SRCS} PARENT_SCOPE) -set(${MODULE_PREFIX}_SERVER_LIBS ${${MODULE_PREFIX}_SERVER_LIBS} PARENT_SCOPE) -set(CHANNEL_BUILTIN_SERVER_MODULES ${CHANNEL_BUILTIN_SERVER_MODULES} ${MODULE_NAME} PARENT_SCOPE) +if(WITH_CLIENT_CHANNELS) + add_subdirectory(client) +endif() +if(WITH_SERVER_CHANNELS) + add_subdirectory(server) + set(${MODULE_PREFIX}_SERVER_SRCS ${${MODULE_PREFIX}_SERVER_SRCS} PARENT_SCOPE) + set(${MODULE_PREFIX}_SERVER_LIBS ${${MODULE_PREFIX}_SERVER_LIBS} PARENT_SCOPE) + set(CHANNEL_BUILTIN_SERVER_MODULES ${CHANNEL_BUILTIN_SERVER_MODULES} ${MODULE_NAME} PARENT_SCOPE) +endif() diff --git a/channels/audin/client/CMakeLists.txt b/channels/audin/client/CMakeLists.txt index 65534eb87..2be9f936b 100644 --- a/channels/audin/client/CMakeLists.txt +++ b/channels/audin/client/CMakeLists.txt @@ -41,4 +41,3 @@ endif() if(WITH_PULSEAUDIO) add_subdirectory(pulse) endif() - diff --git a/channels/cliprdr/CMakeLists.txt b/channels/cliprdr/CMakeLists.txt index e6e70054d..676de4e85 100644 --- a/channels/cliprdr/CMakeLists.txt +++ b/channels/cliprdr/CMakeLists.txt @@ -15,5 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -add_subdirectory(client) +if(WITH_CLIENT_CHANNELS) + add_subdirectory(client) +endif() diff --git a/channels/drdynvc/CMakeLists.txt b/channels/drdynvc/CMakeLists.txt index e6e70054d..676de4e85 100644 --- a/channels/drdynvc/CMakeLists.txt +++ b/channels/drdynvc/CMakeLists.txt @@ -15,5 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -add_subdirectory(client) +if(WITH_CLIENT_CHANNELS) + add_subdirectory(client) +endif() diff --git a/channels/rail/CMakeLists.txt b/channels/rail/CMakeLists.txt index e6e70054d..676de4e85 100644 --- a/channels/rail/CMakeLists.txt +++ b/channels/rail/CMakeLists.txt @@ -15,5 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -add_subdirectory(client) +if(WITH_CLIENT_CHANNELS) + add_subdirectory(client) +endif() diff --git a/channels/rdpdr/CMakeLists.txt b/channels/rdpdr/CMakeLists.txt index e6e70054d..676de4e85 100644 --- a/channels/rdpdr/CMakeLists.txt +++ b/channels/rdpdr/CMakeLists.txt @@ -15,5 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -add_subdirectory(client) +if(WITH_CLIENT_CHANNELS) + add_subdirectory(client) +endif() diff --git a/channels/rdpsnd/CMakeLists.txt b/channels/rdpsnd/CMakeLists.txt index aad0c5af1..14ce938d1 100644 --- a/channels/rdpsnd/CMakeLists.txt +++ b/channels/rdpsnd/CMakeLists.txt @@ -18,12 +18,15 @@ set(MODULE_NAME "rdpsnd") set(MODULE_PREFIX "CHANNEL_RDPSND") -add_subdirectory(client) +if(WITH_CLIENT_CHANNELS) + add_subdirectory(client) +endif() -add_subdirectory(server) - -set(${MODULE_PREFIX}_SERVER_SRCS ${${MODULE_PREFIX}_SERVER_SRCS} PARENT_SCOPE) -set(${MODULE_PREFIX}_SERVER_LIBS ${${MODULE_PREFIX}_SERVER_LIBS} PARENT_SCOPE) -set(CHANNEL_BUILTIN_SERVER_MODULES ${CHANNEL_BUILTIN_SERVER_MODULES} ${MODULE_NAME} PARENT_SCOPE) +if(WITH_SERVER_CHANNELS) + add_subdirectory(server) + set(${MODULE_PREFIX}_SERVER_SRCS ${${MODULE_PREFIX}_SERVER_SRCS} PARENT_SCOPE) + set(${MODULE_PREFIX}_SERVER_LIBS ${${MODULE_PREFIX}_SERVER_LIBS} PARENT_SCOPE) + set(CHANNEL_BUILTIN_SERVER_MODULES ${CHANNEL_BUILTIN_SERVER_MODULES} ${MODULE_NAME} PARENT_SCOPE) +endif() diff --git a/channels/sample/CMakeLists.txt b/channels/sample/CMakeLists.txt index e6e70054d..676de4e85 100644 --- a/channels/sample/CMakeLists.txt +++ b/channels/sample/CMakeLists.txt @@ -15,5 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -add_subdirectory(client) +if(WITH_CLIENT_CHANNELS) + add_subdirectory(client) +endif() diff --git a/channels/server/CMakeLists.txt b/channels/server/CMakeLists.txt index 5b7b8ba24..d36053b2a 100644 --- a/channels/server/CMakeLists.txt +++ b/channels/server/CMakeLists.txt @@ -32,4 +32,3 @@ set_target_properties(freerdp-server PROPERTIES VERSION ${FREERDP_VERSION_FULL} target_link_libraries(freerdp-server ${CHANNEL_SERVER_LIBS}) install(TARGETS freerdp-server DESTINATION ${CMAKE_INSTALL_LIBDIR}) - diff --git a/channels/tsmf/CMakeLists.txt b/channels/tsmf/CMakeLists.txt index e6e70054d..7d38fd55f 100644 --- a/channels/tsmf/CMakeLists.txt +++ b/channels/tsmf/CMakeLists.txt @@ -15,5 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -add_subdirectory(client) +if(WITH_CLIENT_CHANNELS) + add_subdirectory(client) +endif() + diff --git a/cmake/ConfigOptions.cmake b/cmake/ConfigOptions.cmake index 2007b37cf..76fa33a3b 100644 --- a/cmake/ConfigOptions.cmake +++ b/cmake/ConfigOptions.cmake @@ -22,6 +22,15 @@ endif() option(WITH_CLIENT "Build client binaries" ON) option(WITH_SERVER "Build server binaries" OFF) option(WITH_CHANNELS "Build virtual channel plugins" ON) + +if(WITH_CLIENT AND WITH_CHANNELS) + option(WITH_CLIENT_CHANNELS "Build virtual channel plugins" ON) +endif() + +if(WITH_SERVER AND WITH_CHANNELS) + option(WITH_SERVER_CHANNELS "Build virtual channel plugins" ON) +endif() + option(WITH_THIRD_PARTY "Build third-party components" OFF) option(WITH_SERVER_INTERFACE "Build server as a library with an interface" OFF) diff --git a/config.h.in b/config.h.in index 524822f70..74df3e656 100644 --- a/config.h.in +++ b/config.h.in @@ -9,8 +9,10 @@ #define GIT_REVISION "${GIT_REVISION}" #define FREERDP_DATA_PATH "${FREERDP_DATA_PATH}" -#define FREERDP_PLUGIN_PATH "${FREERDP_PLUGIN_PATH}" #define FREERDP_KEYMAP_PATH "${FREERDP_KEYMAP_PATH}" +#define FREERDP_PLUGIN_PATH "${FREERDP_PLUGIN_PATH}" +#define FREERDP_CLIENT_PLUGIN_PATH "${FREERDP_CLIENT_PLUGIN_PATH}" +#define FREERDP_SERVER_PLUGIN_PATH "${FREERDP_SERVER_PLUGIN_PATH}" /* Include files */ #cmakedefine HAVE_FCNTL_H diff --git a/libfreerdp/utils/load_plugin.c b/libfreerdp/utils/load_plugin.c index c36e7ba62..9b713bc76 100644 --- a/libfreerdp/utils/load_plugin.c +++ b/libfreerdp/utils/load_plugin.c @@ -336,12 +336,13 @@ boolean freerdp_register_static_plugin(const char* name, const char* entry_name, */ void* freerdp_load_static_plugin(const char* name, const char* entry_name) { - staticPlugin* plugin; int i; + staticPlugin* plugin; for (i = 0; i < g_static_plugins_count; i++) { plugin = &g_static_plugins[i]; + if (!strcmp(plugin->name, name) && !strcmp(plugin->entry_name, entry_name)) { return plugin->entry_addr; @@ -350,5 +351,3 @@ void* freerdp_load_static_plugin(const char* name, const char* entry_name) return NULL; } - -