xfreerdp: split client into executable and library

This commit is contained in:
Marc-André Moreau
2013-04-02 16:22:30 -04:00
parent f400045bf8
commit 022ceec22a
9 changed files with 57 additions and 12 deletions

View File

@@ -44,7 +44,6 @@ else()
add_executable(${MODULE_NAME} WIN32 ${${MODULE_PREFIX}_SRCS})
endif()
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-client)
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS

View File

@@ -15,8 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set(MODULE_NAME "xfreerdp")
set(MODULE_PREFIX "FREERDP_CLIENT_X11")
set(MODULE_NAME "xfreerdp-client")
set(MODULE_PREFIX "FREERDP_CLIENT_X11_CONTROL")
include(FindXmlto)
include_directories(${X11_INCLUDE_DIRS})
@@ -41,11 +41,15 @@ set(${MODULE_PREFIX}_SRCS
xf_window.c
xf_window.h
xf_interface.c
xf_interface.h
xfreerdp.c
xfreerdp.h)
xf_interface.h)
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
if(WITH_CLIENT_INTERFACE)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION} PREFIX "lib")
else()
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} cli/xfreerdp.c cli/xfreerdp.h)
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
endif()
set(${MODULE_PREFIX}_LIBS
${X11_LIBRARIES}
@@ -130,6 +134,12 @@ if(WITH_IPP)
target_link_libraries(xfreerdp ${IPP_LIBRARY_LIST})
endif()
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
if(WITH_CLIENT_INTERFACE)
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
add_subdirectory(cli)
else()
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/X11")

View File

@@ -0,0 +1,36 @@
# FreeRDP: A Remote Desktop Protocol Implementation
# FreeRDP X11 cmake build script
#
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
#
# 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.
set(MODULE_NAME "xfreerdp")
set(MODULE_PREFIX "FREERDP_CLIENT_X11")
include_directories(..)
set(${MODULE_PREFIX}_SRCS
xfreerdp.c
xfreerdp.h)
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} xfreerdp-client)
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
install(TARGETS ${MODULE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/X11")

BIN
client/X11/cli/xfreerdp Executable file

Binary file not shown.

View File

@@ -74,8 +74,6 @@
#include "xf_graphics.h"
#include "xf_keyboard.h"
#include "xfreerdp.h"
static long xv_port = 0;
static const size_t password_size = 512;
@@ -1439,6 +1437,8 @@ void* xf_thread(void* param)
gdi_free(instance);
xf_free(xfi);
exit_code = 123;
ExitThread(exit_code);
}

View File

@@ -66,7 +66,7 @@ DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds)
fprintf(stderr, "WaitForSingleObject: pthread_join failure: %d\n", status);
if (thread_status)
thread->dwExitCode = ((DWORD*) thread_status);
thread->dwExitCode = ((DWORD) (size_t) thread_status);
}
else if (Type == HANDLE_TYPE_MUTEX)
{

View File

@@ -125,7 +125,7 @@ HANDLE CreateRemoteThread(HANDLE hProcess, LPSECURITY_ATTRIBUTES lpThreadAttribu
VOID ExitThread(DWORD dwExitCode)
{
pthread_exit((void*) dwExitCode);
pthread_exit((void*) (size_t) dwExitCode);
}
BOOL GetExitCodeThread(HANDLE hThread, LPDWORD lpExitCode)