Fixed windows overlinking.
This commit is contained in:
parent
7abc86ffae
commit
8e0565b2bd
@ -19,7 +19,8 @@ include(CheckFunctionExists)
|
|||||||
|
|
||||||
set(WINPR_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
set(WINPR_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
set(WINPR_SRCS "")
|
set(WINPR_SRCS "")
|
||||||
set(WINPR_LIBS "")
|
set(WINPR_LIBS_PRIVATE "")
|
||||||
|
set(WINPR_LIBS_PUBLIC "")
|
||||||
set(WINPR_INCLUDES "")
|
set(WINPR_INCLUDES "")
|
||||||
set(WINPR_DEFINITIONS "")
|
set(WINPR_DEFINITIONS "")
|
||||||
|
|
||||||
@ -55,11 +56,18 @@ macro (winpr_include_directory_add)
|
|||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro (winpr_library_add)
|
macro (winpr_library_add_private)
|
||||||
foreach (_lib ${ARGN})
|
foreach (_lib ${ARGN})
|
||||||
list (APPEND WINPR_LIBS "${_lib}")
|
list (APPEND WINPR_LIBS_PRIVATE "${_lib}")
|
||||||
endforeach()
|
endforeach()
|
||||||
set (WINPR_LIBS ${WINPR_LIBS} PARENT_SCOPE)
|
set (WINPR_LIBS_PRIVATE ${WINPR_LIBS_PRIVATE} PARENT_SCOPE)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro (winpr_library_add_public)
|
||||||
|
foreach (_lib ${ARGN})
|
||||||
|
list (APPEND WINPR_LIBS_PUBLIC "${_lib}")
|
||||||
|
endforeach()
|
||||||
|
set (WINPR_LIBS_PUBLIC ${WINPR_LIBS_PUBLIC} PARENT_SCOPE)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro (winpr_definition_add)
|
macro (winpr_definition_add)
|
||||||
@ -76,11 +84,11 @@ check_function_exists(timer_settime TIMER_SETTIME)
|
|||||||
check_function_exists(timer_gettime TIMER_GETTIME)
|
check_function_exists(timer_gettime TIMER_GETTIME)
|
||||||
if (TIMER_CREATE AND TIMER_DELETE AND TIMER_SETTIME AND TIMER_GETTIME)
|
if (TIMER_CREATE AND TIMER_DELETE AND TIMER_SETTIME AND TIMER_GETTIME)
|
||||||
add_definitions(-DWITH_POSIX_TIMER)
|
add_definitions(-DWITH_POSIX_TIMER)
|
||||||
winpr_library_add(rt)
|
winpr_library_add_private(rt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
winpr_library_add(log)
|
winpr_library_add_private(log)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Level "1" API as defined for MinCore.lib
|
# Level "1" API as defined for MinCore.lib
|
||||||
@ -103,7 +111,8 @@ endforeach()
|
|||||||
|
|
||||||
set(MODULE_NAME winpr)
|
set(MODULE_NAME winpr)
|
||||||
list(REMOVE_DUPLICATES WINPR_DEFINITIONS)
|
list(REMOVE_DUPLICATES WINPR_DEFINITIONS)
|
||||||
list(REMOVE_DUPLICATES WINPR_LIBS)
|
list(REMOVE_DUPLICATES WINPR_LIBS_PRIVATE)
|
||||||
|
list(REMOVE_DUPLICATES WINPR_LIBS_PUBLIC)
|
||||||
list(REMOVE_DUPLICATES WINPR_INCLUDES)
|
list(REMOVE_DUPLICATES WINPR_INCLUDES)
|
||||||
include_directories(${WINPR_INCLUDES})
|
include_directories(${WINPR_INCLUDES})
|
||||||
|
|
||||||
@ -121,7 +130,7 @@ if (WIN32)
|
|||||||
@ONLY)
|
@ONLY)
|
||||||
|
|
||||||
set (WINPR_SRCS ${WINPR_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
set (WINPR_SRCS ${WINPR_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
||||||
list(APPEND WINPR_LIBS "shlwapi")
|
winpr_library_add_public("shlwapi")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(${MODULE_NAME} ${WINPR_SRCS})
|
add_library(${MODULE_NAME} ${WINPR_SRCS})
|
||||||
@ -132,11 +141,7 @@ if (WITH_LIBRARY_VERSIONING)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(${WINPR_DEFINITIONS})
|
add_definitions(${WINPR_DEFINITIONS})
|
||||||
if (WIN32)
|
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${WINPR_LIBS_PRIVATE} ${PUBLIC_KEYWORD} ${WINPR_LIBS_PUBLIC})
|
||||||
target_link_libraries(${MODULE_NAME} ${PUBLIC_KEYWORD} ${WINPR_LIBS})
|
|
||||||
else()
|
|
||||||
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${WINPR_LIBS})
|
|
||||||
endif(WIN32)
|
|
||||||
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries EXPORT WinPRTargets)
|
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries EXPORT WinPRTargets)
|
||||||
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
|
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
|
||||||
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
|
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
winpr_module_add(credui.c)
|
winpr_module_add(credui.c)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
winpr_library_add(credui)
|
winpr_library_add_public(credui)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -31,7 +31,7 @@ endif(NOT WITH_ICU)
|
|||||||
if (WITH_ICU)
|
if (WITH_ICU)
|
||||||
find_package(ICU REQUIRED i18n uc io)
|
find_package(ICU REQUIRED i18n uc io)
|
||||||
include_directories(${ICU_INCLUDE_DIRS})
|
include_directories(${ICU_INCLUDE_DIRS})
|
||||||
winpr_library_add(${ICU_LIBRARIES})
|
winpr_library_add_private(${ICU_LIBRARIES})
|
||||||
endif (WITH_ICU)
|
endif (WITH_ICU)
|
||||||
|
|
||||||
winpr_module_add(${CRT_FILES})
|
winpr_module_add(${CRT_FILES})
|
||||||
|
@ -25,16 +25,16 @@ winpr_module_add(
|
|||||||
|
|
||||||
if(OPENSSL_FOUND)
|
if(OPENSSL_FOUND)
|
||||||
winpr_include_directory_add(${OPENSSL_INCLUDE_DIR})
|
winpr_include_directory_add(${OPENSSL_INCLUDE_DIR})
|
||||||
winpr_library_add(${OPENSSL_LIBRARIES})
|
winpr_library_add_private(${OPENSSL_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MBEDTLS_FOUND)
|
if(MBEDTLS_FOUND)
|
||||||
winpr_include_directory_add(${MBEDTLS_INCLUDE_DIR})
|
winpr_include_directory_add(${MBEDTLS_INCLUDE_DIR})
|
||||||
winpr_library_add(${MBEDTLS_LIBRARIES})
|
winpr_library_add_private(${MBEDTLS_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
winpr_library_add(crypt32)
|
winpr_library_add_public(crypt32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
winpr_module_add(dsparse.c)
|
winpr_module_add(dsparse.c)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
winpr_library_add(ntdsapi)
|
winpr_library_add_public(ntdsapi)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -19,5 +19,5 @@
|
|||||||
winpr_module_add(handle.c handle.h nonehandle.c nonehandle.h)
|
winpr_module_add(handle.c handle.h nonehandle.c nonehandle.h)
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES SunOS)
|
if(${CMAKE_SYSTEM_NAME} MATCHES SunOS)
|
||||||
winpr_library_add(rt)
|
winpr_library_add_private(rt)
|
||||||
endif()
|
endif()
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
winpr_module_add(locale.c)
|
winpr_module_add(locale.c)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
winpr_library_add(ntdsapi)
|
winpr_library_add_public(ntdsapi)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -17,12 +17,12 @@
|
|||||||
|
|
||||||
winpr_module_add(nt.c)
|
winpr_module_add(nt.c)
|
||||||
|
|
||||||
winpr_library_add(
|
winpr_library_add_private(
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${CMAKE_DL_LIBS})
|
${CMAKE_DL_LIBS})
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES SunOS)
|
if(${CMAKE_SYSTEM_NAME} MATCHES SunOS)
|
||||||
winpr_library_add(rt)
|
winpr_library_add_private(rt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -26,12 +26,12 @@ winpr_module_add(
|
|||||||
callback.c
|
callback.c
|
||||||
callback_cleanup.c)
|
callback_cleanup.c)
|
||||||
|
|
||||||
winpr_library_add(
|
winpr_library_add_private(
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${CMAKE_DL_LIBS})
|
${CMAKE_DL_LIBS})
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES SunOS)
|
if(${CMAKE_SYSTEM_NAME} MATCHES SunOS)
|
||||||
winpr_library_add(rt)
|
winpr_library_add_private(rt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -40,8 +40,8 @@ winpr_module_add(
|
|||||||
|
|
||||||
winpr_include_directory_add(${OPENSSL_INCLUDE_DIR})
|
winpr_include_directory_add(${OPENSSL_INCLUDE_DIR})
|
||||||
|
|
||||||
winpr_library_add(${OPENSSL_LIBRARIES})
|
winpr_library_add_private(${OPENSSL_LIBRARIES})
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
winpr_library_add(ws2_32 rpcrt4)
|
winpr_library_add_public(ws2_32 rpcrt4)
|
||||||
endif()
|
endif()
|
||||||
|
@ -42,7 +42,7 @@ endif()
|
|||||||
winpr_module_add(${${MODULE_PREFIX}_SRCS})
|
winpr_module_add(${${MODULE_PREFIX}_SRCS})
|
||||||
|
|
||||||
if(PCSC_WINPR_FOUND)
|
if(PCSC_WINPR_FOUND)
|
||||||
winpr_library_add(${PCSC_WINPR_LIBRARY})
|
winpr_library_add_private(${PCSC_WINPR_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -63,21 +63,21 @@ winpr_module_add(${${MODULE_PREFIX}_CREDSSP_SRCS}
|
|||||||
|
|
||||||
if(OPENSSL_FOUND)
|
if(OPENSSL_FOUND)
|
||||||
winpr_include_directory_add(${OPENSSL_INCLUDE_DIR})
|
winpr_include_directory_add(${OPENSSL_INCLUDE_DIR})
|
||||||
winpr_library_add(${OPENSSL_LIBRARIES})
|
winpr_library_add_private(${OPENSSL_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MBEDTLS_FOUND)
|
if(MBEDTLS_FOUND)
|
||||||
winpr_include_directory_add(${MBEDTLS_INCLUDE_DIR})
|
winpr_include_directory_add(${MBEDTLS_INCLUDE_DIR})
|
||||||
winpr_library_add(${MBEDTLS_LIBRARIES})
|
winpr_library_add_private(${MBEDTLS_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(GSS_FOUND)
|
if(GSS_FOUND)
|
||||||
winpr_include_directory_add(${GSS_INCLUDE_DIR})
|
winpr_include_directory_add(${GSS_INCLUDE_DIR})
|
||||||
winpr_library_add(${GSS_LIBRARIES})
|
winpr_library_add_private(${GSS_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
winpr_library_add(ws2_32)
|
winpr_library_add_public(ws2_32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -32,7 +32,7 @@ winpr_module_add(
|
|||||||
|
|
||||||
if(FREEBSD)
|
if(FREEBSD)
|
||||||
winpr_include_directory_add(${EPOLLSHIM_INCLUDE_DIR})
|
winpr_include_directory_add(${EPOLLSHIM_INCLUDE_DIR})
|
||||||
winpr_library_add(${EPOLLSHIM_LIBS})
|
winpr_library_add_private(${EPOLLSHIM_LIBS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -22,7 +22,7 @@ endif()
|
|||||||
winpr_module_add(sysinfo.c)
|
winpr_module_add(sysinfo.c)
|
||||||
|
|
||||||
if((NOT WIN32) AND (NOT APPLE) AND (NOT ANDROID) AND (NOT OPENBSD))
|
if((NOT WIN32) AND (NOT APPLE) AND (NOT ANDROID) AND (NOT OPENBSD))
|
||||||
winpr_library_add(rt)
|
winpr_library_add_private(rt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -24,7 +24,7 @@ winpr_module_add(
|
|||||||
tls.c)
|
tls.c)
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES SunOS)
|
if(${CMAKE_SYSTEM_NAME} MATCHES SunOS)
|
||||||
winpr_library_add(rt)
|
winpr_library_add_private(rt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -66,7 +66,7 @@ if (LIBSYSTEMD_FOUND)
|
|||||||
)
|
)
|
||||||
|
|
||||||
winpr_include_directory_add(${LIBSYSTEMD_INCLUDE_DIR})
|
winpr_include_directory_add(${LIBSYSTEMD_INCLUDE_DIR})
|
||||||
winpr_library_add(${LIBSYSTEMD_LIBRARY})
|
winpr_library_add_private(${LIBSYSTEMD_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${MODULE_PREFIX}_WLOG_SRCS
|
set(${MODULE_PREFIX}_WLOG_SRCS
|
||||||
@ -130,24 +130,24 @@ winpr_include_directory_add(
|
|||||||
|
|
||||||
if(OPENSSL_FOUND)
|
if(OPENSSL_FOUND)
|
||||||
winpr_include_directory_add(${OPENSSL_INCLUDE_DIR})
|
winpr_include_directory_add(${OPENSSL_INCLUDE_DIR})
|
||||||
winpr_library_add(${OPENSSL_LIBRARIES})
|
winpr_library_add_private(${OPENSSL_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MBEDTLS_FOUND)
|
if(MBEDTLS_FOUND)
|
||||||
winpr_include_directory_add(${MBEDTLS_INCLUDE_DIR})
|
winpr_include_directory_add(${MBEDTLS_INCLUDE_DIR})
|
||||||
winpr_library_add(${MBEDTLS_LIBRARIES})
|
winpr_library_add_private(${MBEDTLS_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
winpr_library_add(m)
|
winpr_library_add_private(m)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if((FREEBSD) AND (NOT KFREEBSD))
|
if((FREEBSD) AND (NOT KFREEBSD))
|
||||||
winpr_library_add(execinfo)
|
winpr_library_add_private(execinfo)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
winpr_library_add(dbghelp)
|
winpr_library_add_public(dbghelp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -18,5 +18,5 @@
|
|||||||
winpr_module_add(winsock.c)
|
winpr_module_add(winsock.c)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
winpr_library_add(ws2_32)
|
winpr_library_add_public(ws2_32)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user