cmake: refactoring of channel scripts

This commit is contained in:
Marc-André Moreau 2012-10-14 02:38:58 -04:00
parent 6a592b5720
commit 0feebdbc37
31 changed files with 241 additions and 54 deletions

View File

@ -15,11 +15,18 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(MODULE_NAME "audin") set(CHANNEL_NAME "audin")
set(MODULE_NAME ${CHANNEL_NAME})
set(MODULE_PREFIX "CHANNEL_AUDIN") set(MODULE_PREFIX "CHANNEL_AUDIN")
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${${MODULE_PREFIX}_CLIENT_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif()
endif() endif()
if(WITH_SERVER_CHANNELS) if(WITH_SERVER_CHANNELS)
@ -31,4 +38,3 @@ if(WITH_SERVER_CHANNELS)
set(${MODULE_PREFIX}_SERVER_ENTRY ${${MODULE_PREFIX}_SERVER_ENTRY} PARENT_SCOPE) set(${MODULE_PREFIX}_SERVER_ENTRY ${${MODULE_PREFIX}_SERVER_ENTRY} PARENT_SCOPE)
endif() endif()
endif() endif()

View File

@ -24,7 +24,15 @@ set(${MODULE_PREFIX}_SRCS
include_directories(..) include_directories(..)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) if(NOT STATIC_CHANNELS)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
else()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "DVCPluginEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
endif()
set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS

View File

@ -523,6 +523,10 @@ static BOOL audin_process_plugin_data(IWTSPlugin* pPlugin, RDP_PLUGIN_DATA* data
return TRUE; return TRUE;
} }
#ifdef STATIC_CHANNELS
#define DVCPluginEntry audin_DVCPluginEntry
#endif
int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
{ {
int error = 0; int error = 0;

View File

@ -15,14 +15,16 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(MODULE_NAME "cliprdr") set(CHANNEL_NAME "cliprdr")
set(MODULE_PREFIX "CHANNEL_CLIPRDR") set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC) if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE) set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${${MODULE_PREFIX}_CLIENT_NAME} PARENT_SCOPE) set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE) set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif() endif()
endif() endif()

View File

@ -29,17 +29,21 @@ set(${MODULE_PREFIX}_SRCS
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE) set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE) set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "VirtualChannelEntry" PARENT_SCOPE) set(${MODULE_PREFIX}_ENTRY "DVCPluginEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS}) add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
if(MONOLITHIC_BUILD) set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
target_link_libraries(${MODULE_NAME} freerdp winpr) MONOLITHIC ${MONOLITHIC_BUILD}
else() MODULE freerdp
target_link_libraries(${MODULE_NAME} freerdp-utils winpr-crt) MODULES freerdp-utils)
endif()
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE winpr
MODULES winpr-crt)
install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_PLUGIN_PATH}) install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_PLUGIN_PATH})

View File

@ -15,14 +15,16 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(MODULE_NAME "disk") set(CHANNEL_NAME "disk")
set(MODULE_PREFIX "CHANNEL_RDPDR_DISK") set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC) if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE) set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${${MODULE_PREFIX}_CLIENT_NAME} PARENT_SCOPE) set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE) set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif() endif()
endif() endif()

View File

@ -40,7 +40,6 @@ else()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE) set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE) set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "DeviceServiceEntry" PARENT_SCOPE) set(${MODULE_PREFIX}_ENTRY "DeviceServiceEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS}) add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
endif() endif()

View File

@ -15,14 +15,16 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(MODULE_NAME "drdynvc") set(CHANNEL_NAME "drdynvc")
set(MODULE_PREFIX "CHANNEL_DRDYNVC") set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC) if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE) set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${${MODULE_PREFIX}_CLIENT_NAME} PARENT_SCOPE) set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE) set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif() endif()
endif() endif()

View File

@ -15,7 +15,17 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(CHANNEL_NAME "parallel")
set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif()
endif() endif()

View File

@ -21,7 +21,14 @@ set(MODULE_PREFIX "CHANNEL_RDPDR_PARALLEL_CLIENT")
set(${MODULE_PREFIX}_SRCS set(${MODULE_PREFIX}_SRCS
parallel_main.c) parallel_main.c)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) if(NOT STATIC_CHANNELS)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
else()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "DVCPluginEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
endif()
set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")

View File

@ -307,6 +307,10 @@ static void parallel_free(DEVICE* device)
free(parallel); free(parallel);
} }
#ifdef STATIC_CHANNELS
#define DeviceServiceEntry parallel_DeviceServiceEntry
#endif
int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
{ {
char* name; char* name;

View File

@ -15,7 +15,17 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(CHANNEL_NAME "printer")
set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif()
endif() endif()

View File

@ -37,7 +37,14 @@ if(WIN32)
printer_win.h) printer_win.h)
endif() endif()
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) if(NOT STATIC_CHANNELS)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
else()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "DVCPluginEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
endif()
set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")

View File

@ -301,10 +301,10 @@ void printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, rdpPrinter* pri
} }
#ifdef STATIC_CHANNELS #ifdef STATIC_CHANNELS
int printer_entry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) #define DeviceServiceEntry printer_DeviceServiceEntry
#else
int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
#endif #endif
int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
{ {
int i; int i;
char* name; char* name;

View File

@ -15,11 +15,16 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(CHANNEL_NAME "rail")
set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC) if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE) set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${${MODULE_PREFIX}_CLIENT_NAME} PARENT_SCOPE) set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE) set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif() endif()
endif() endif()

View File

@ -15,14 +15,16 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(MODULE_NAME "rdpdr") set(CHANNEL_NAME "rdpdr")
set(MODULE_PREFIX "CHANNEL_RDPDR") set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC) if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE) set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${${MODULE_PREFIX}_CLIENT_NAME} PARENT_SCOPE) set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE) set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif() endif()
endif() endif()

View File

@ -15,14 +15,16 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(MODULE_NAME "rdpsnd") set(CHANNEL_NAME "rdpsnd")
set(MODULE_PREFIX "CHANNEL_RDPSND") set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC) if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE) set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${${MODULE_PREFIX}_CLIENT_NAME} PARENT_SCOPE) set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE) set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif() endif()
endif() endif()
@ -36,4 +38,3 @@ if(WITH_SERVER_CHANNELS)
set(${MODULE_PREFIX}_SERVER_ENTRY ${${MODULE_PREFIX}_SERVER_ENTRY} PARENT_SCOPE) set(${MODULE_PREFIX}_SERVER_ENTRY ${${MODULE_PREFIX}_SERVER_ENTRY} PARENT_SCOPE)
endif() endif()
endif() endif()

View File

@ -15,7 +15,17 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(CHANNEL_NAME "sample")
set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif()
endif() endif()

View File

@ -22,7 +22,15 @@ set(${MODULE_PREFIX}_SRCS
skel_main.c skel_main.c
skel_main.h) skel_main.h)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) if(NOT STATIC_CHANNELS)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
else()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "DVCPluginEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
endif()
set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS

View File

@ -40,7 +40,7 @@
#include "skel_main.h" #include "skel_main.h"
struct skel_plugin struct sample_plugin
{ {
rdpSvcPlugin plugin; rdpSvcPlugin plugin;
@ -48,12 +48,12 @@ struct skel_plugin
}; };
static void skel_process_interval(rdpSvcPlugin* plugin) static void sample_process_interval(rdpSvcPlugin* plugin)
{ {
printf("skel_process_interval:\n"); printf("skel_process_interval:\n");
} }
static void skel_process_receive(rdpSvcPlugin* plugin, STREAM* data_in) static void sample_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
{ {
skelPlugin* skel = (skelPlugin*)plugin; skelPlugin* skel = (skelPlugin*)plugin;
STREAM* data_out; STREAM* data_out;
@ -88,27 +88,27 @@ static void skel_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
stream_free(data_in); stream_free(data_in);
} }
static void skel_process_connect(rdpSvcPlugin* plugin) static void sample_process_connect(rdpSvcPlugin* plugin)
{ {
skelPlugin* skel = (skelPlugin*)plugin; samplePlugin* sample = (samplePlugin*) plugin;
DEBUG_SVC("connecting"); DEBUG_SVC("connecting");
printf("skel_process_connect:\n"); printf("sample_process_connect:\n");
if (skel == NULL) if (sample == NULL)
{ {
return; return;
} }
/* if you want a call from channel thread once is a while do this */ /* if you want a call from channel thread once is a while do this */
plugin->interval_ms = 1000; plugin->interval_ms = 1000;
plugin->interval_callback = skel_process_interval; plugin->interval_callback = sample_process_interval;
} }
static void skel_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event) static void sample_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event)
{ {
printf("skel_process_event:\n"); printf("sample_process_event:\n");
/* events comming from main freerdp window to plugin */ /* events comming from main freerdp window to plugin */
/* send them back with svc_plugin_send_event */ /* send them back with svc_plugin_send_event */
@ -116,11 +116,11 @@ static void skel_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event)
freerdp_event_free(event); freerdp_event_free(event);
} }
static void skel_process_terminate(rdpSvcPlugin* plugin) static void sample_process_terminate(rdpSvcPlugin* plugin)
{ {
skelPlugin* skel = (skelPlugin*)plugin; skelPlugin* skel = (skelPlugin*)plugin;
printf("skel_process_terminate:\n"); printf("sample_process_terminate:\n");
if (skel == NULL) if (skel == NULL)
{ {
@ -132,5 +132,27 @@ static void skel_process_terminate(rdpSvcPlugin* plugin)
free(plugin); free(plugin);
} }
DEFINE_SVC_PLUGIN(skel, "skel", #define VirtualChannelEntry sample_VirtualChannelEntry
CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP)
const int VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{
samplePlugin* _p;
_p = (samplePlugin*) malloc(sizeof(samplePlugin));
ZeroMemory(_p, sizeof(samplePlugin));
_p->plugin.channel_def.options =
CHANNEL_OPTION_INITIALIZED |
CHANNEL_OPTION_ENCRYPT_RDP;
strcpy(_p->plugin.channel_def.name, "sample");
_p->plugin.connect_callback = sample_process_connect;
_p->plugin.receive_callback = sample_process_receive;
_p->plugin.event_callback = sample_process_event;
_p->plugin.terminate_callback = sample_process_terminate;
svc_plugin_init((rdpSvcPlugin*) _p, pEntryPoints);
return 1;
}

View File

@ -18,9 +18,9 @@
* limitations under the License. * limitations under the License.
*/ */
#ifndef __SKEL_MAIN_H #ifndef __SAMPLE_MAIN_H
#define __SKEL_MAIN_H #define __SAMPLE_MAIN_H
typedef struct skel_plugin skelPlugin; typedef struct sample_plugin samplePlugin;
#endif /* __SKEL_MAIN_H */ #endif /* __SAMPLE_MAIN_H */

View File

@ -15,7 +15,17 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(CHANNEL_NAME "serial")
set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif()
endif() endif()

View File

@ -24,7 +24,15 @@ set(${MODULE_PREFIX}_SRCS
serial_constants.h serial_constants.h
serial_main.c) serial_main.c)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) if(NOT STATIC_CHANNELS)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
else()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "DeviceServiceEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
endif()
set_target_properties(serial PROPERTIES PREFIX "") set_target_properties(serial PROPERTIES PREFIX "")
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS

View File

@ -397,6 +397,10 @@ static void serial_free(DEVICE* device)
free(serial); free(serial);
} }
#ifdef STATIC_CHANNELS
#define DeviceServiceEntry serial_DeviceServiceEntry
#endif
int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
{ {
int i, len; int i, len;

View File

@ -15,7 +15,17 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(CHANNEL_NAME "smartcard")
set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif()
endif() endif()

View File

@ -282,6 +282,10 @@ static void scard_irp_request(DEVICE* device, IRP* irp)
freerdp_thread_signal(scard->thread); freerdp_thread_signal(scard->thread);
} }
#ifdef STATIC_CHANNELS
#define DeviceServiceEntry smartcard_DeviceServiceEntry
#endif
int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
{ {
char* name; char* name;

View File

@ -15,8 +15,18 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(CHANNEL_NAME "tsmf")
set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif()
endif() endif()

View File

@ -425,12 +425,17 @@ static void tsmf_process_plugin_data(IWTSPlugin* pPlugin, RDP_PLUGIN_DATA* data)
} }
} }
#ifdef STATIC_CHANNELS
#define DVCPluginEntry tsmf_DVCPluginEntry
#endif
int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
{ {
TSMF_PLUGIN * tsmf;
int error = 0; int error = 0;
TSMF_PLUGIN* tsmf;
tsmf = (TSMF_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "tsmf"); tsmf = (TSMF_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "tsmf");
if (tsmf == NULL) if (tsmf == NULL)
{ {
tsmf = xnew(TSMF_PLUGIN); tsmf = xnew(TSMF_PLUGIN);
@ -448,6 +453,7 @@ int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
tsmf_process_plugin_data((IWTSPlugin*) tsmf, tsmf_process_plugin_data((IWTSPlugin*) tsmf,
pEntryPoints->GetPluginData(pEntryPoints)); pEntryPoints->GetPluginData(pEntryPoints));
} }
return error; return error;
} }

View File

@ -15,8 +15,18 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(CHANNEL_NAME "urbdrc")
set(MODULE_NAME ${CHANNEL_NAME})
string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX)
add_subdirectory(libusb) add_subdirectory(libusb)
if(WITH_CLIENT_CHANNELS) if(WITH_CLIENT_CHANNELS)
add_subdirectory(client) add_subdirectory(client)
if(${MODULE_PREFIX}_CLIENT_STATIC)
set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${MODULE_PREFIX} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_NAME ${CHANNEL_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_CHANNEL ${${MODULE_PREFIX}_CLIENT_CHANNEL} PARENT_SCOPE)
set(${MODULE_PREFIX}_CLIENT_ENTRY ${${MODULE_PREFIX}_CLIENT_ENTRY} PARENT_SCOPE)
endif()
endif() endif()

View File

@ -32,7 +32,15 @@ set(${MODULE_PREFIX}_SRCS
include_directories(..) include_directories(..)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) if(NOT STATIC_CHANNELS)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
else()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "DVCPluginEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
endif()
set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
set(${MODULE_PREFIX}_LIBS set(${MODULE_PREFIX}_LIBS

View File

@ -1042,6 +1042,10 @@ static int urbdrc_process_plugin_data(IWTSPlugin* pPlugin, RDP_PLUGIN_DATA* data
return TRUE; return TRUE;
} }
#ifdef STATIC_CHANNELS
#define DVCPluginEntry urbdrc_DVCPluginEntry
#endif
int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
{ {
int error = 0; int error = 0;