When building intree zlib, build zlibstatic not shared.

This commit is contained in:
James Benton 2018-06-14 14:06:03 +01:00
parent b48055dcb5
commit 2420cf70d5
6 changed files with 11 additions and 16 deletions

View File

@ -9,6 +9,6 @@ add_executable(elf2rpl
target_link_libraries(elf2rpl
excmd
fmt
zlib)
zlibstatic)
install(TARGETS elf2rpl RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")

View File

@ -11,16 +11,15 @@ find_package(ZLIB QUIET)
if(NOT ZLIB_FOUND)
# Disable zlib install
set(SKIP_INSTALL_ALL 1)
set(BUILD_SHARED_LIBS OFF)
add_subdirectory(zlib)
target_include_directories(zlib INTERFACE
target_include_directories(zlibstatic INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/zlib"
"${CMAKE_CURRENT_BINARY_DIR}/zlib")
install(FILES "${CMAKE_BINARY_DIR}/bin/zlib.dll"
DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
else()
add_library(zlib INTERFACE)
target_link_libraries(zlib INTERFACE ${ZLIB_LIBRARIES})
target_include_directories(zlib INTERFACE ${ZLIB_INCLUDE_DIR})
# Not actually static, but who cares...
add_library(zlibstatic INTERFACE)
target_link_libraries(zlibstatic INTERFACE ${ZLIB_LIBRARIES})
target_include_directories(zlibstatic INTERFACE ${ZLIB_INCLUDE_DIR})
endif()

View File

@ -13,6 +13,6 @@ add_executable(readrpl
target_link_libraries(readrpl
excmd
fmt
zlib)
zlibstatic)
install(TARGETS readrpl RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")

View File

@ -4,6 +4,6 @@ add_executable(rplexportgen
rplexportgen.cpp)
target_link_libraries(rplexportgen
zlib)
zlibstatic)
install(TARGETS rplexportgen RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")

View File

@ -4,6 +4,6 @@ add_executable(rplimportgen
rplimportgen.cpp)
target_link_libraries(rplimportgen
zlib)
zlibstatic)
install(TARGETS rplimportgen RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")

View File

@ -1,11 +1,7 @@
project(udplogserver)
file(GLOB_RECURSE SOURCE_FILES *.cpp)
file(GLOB_RECURSE HEADER_FILES *.h)
add_executable(udplogserver
${SOURCE_FILES}
${HEADER_FILES})
main.cpp)
if(MSVC)
target_link_libraries(udplogserver PRIVATE ws2_32)