From 1c558822681bbed5121bcc19816cbbac6a437b2a Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 6 Mar 2024 21:45:22 +0100 Subject: Limited uses of zlib to just ArchiveEx This coincidentally fixes the issue with exceptions not getting caught correctly resulting in unexpected game/server terminations. --- ArchiveEx/CMakeLists.txt | 42 ++++++++++++------------------------------ 1 file changed, 12 insertions(+), 30 deletions(-) (limited to 'ArchiveEx') diff --git a/ArchiveEx/CMakeLists.txt b/ArchiveEx/CMakeLists.txt index 99ea254..faaedda 100644 --- a/ArchiveEx/CMakeLists.txt +++ b/ArchiveEx/CMakeLists.txt @@ -1,33 +1,15 @@ project(ArchiveEx) -add_library( - ArchiveEx - Archive.cpp - ) -target_include_directories( - ArchiveEx - PUBLIC . - ) -target_link_libraries( - ArchiveEx - PRIVATE Zlib::zlib - ) -add_executable( - dat - dat.cpp - ) -target_link_libraries( - dat - PRIVATE ArchiveEx - ) + + +add_library(${PROJECT_NAME} SHARED Archive.cpp) +target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(${PROJECT_NAME} PRIVATE Zlib::zlibstatic) +install(TARGETS ${PROJECT_NAME} RUNTIME COMPONENT Runtime DESTINATION ${CMAKE_INSTALL_PREFIX}) + + +add_executable(dat dat.cpp) +target_link_libraries(dat PRIVATE ${PROJECT_NAME}) if(WIN32) - target_link_libraries( - dat - PRIVATE -l:libshlwapi.a - ) + target_link_libraries(dat PRIVATE -lshlwapi) endif() -install( - TARGETS dat - RUNTIME - COMPONENT Runtime - DESTINATION ${CMAKE_INSTALL_PREFIX} - ) +install(TARGETS dat RUNTIME COMPONENT Tools DESTINATION ${CMAKE_INSTALL_PREFIX}) -- cgit v1.1