Skip to content

Commit a90b2ff

Browse files
committed
build zlibstatic lib
1 parent 9137cee commit a90b2ff

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
22

3+
# Disable the CMP0002 policy error by setting it to OLD
4+
# if(POLICY CMP0002)
5+
# cmake_policy(SET CMP0002 OLD)
6+
# endif()
7+
38
project("SpaceCheckers" VERSION 1.0.10
49
HOMEPAGE_URL "https://github.com/Longwater1234/space-checkers")
510

dependencies/ixwebsocket.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ if(ixwebsocket_ADDED)
2525
target_link_libraries(ixwebsocket PUBLIC ${CMAKE_THREAD_LIBS_INIT})
2626
endif()
2727

28-
if(TARGET zlib)
28+
if(TARGET zlibstatic)
2929
message(STATUS "ixwebsocket: zlib support enabled")
3030
target_compile_definitions(ixwebsocket PRIVATE IXWEBSOCKET_USE_ZLIB)
31-
target_link_libraries(ixwebsocket PRIVATE zlib)
31+
target_link_libraries(ixwebsocket PRIVATE zlibstatic)
3232
else()
3333
message(STATUS "ixwebsocket: zlib support disabled (include zlib first)")
3434
endif()

dependencies/zlib.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CPMAddPackage(
99
)
1010

1111
if(zlib_ADDED)
12-
add_library(zlib STATIC
12+
add_library(zlibstatic STATIC
1313
${zlib_SOURCE_DIR}/adler32.c
1414
${zlib_SOURCE_DIR}/compress.c
1515
${zlib_SOURCE_DIR}/crc32.c
@@ -30,11 +30,11 @@ if(zlib_ADDED)
3030
include(CheckIncludeFile)
3131
check_include_file(unistd.h Z_HAVE_UNISTD_H)
3232
if(Z_HAVE_UNISTD_H)
33-
target_compile_definitions(zlib PRIVATE Z_HAVE_UNISTD_H)
33+
target_compile_definitions(zlibstatic PRIVATE Z_HAVE_UNISTD_H)
3434
endif()
3535

3636
if(MSVC)
37-
target_compile_definitions(zlib PRIVATE _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE)
37+
target_compile_definitions(zlibstatic PRIVATE _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE)
3838
endif()
39-
target_include_directories(zlib PUBLIC ${zlib_SOURCE_DIR})
39+
target_include_directories(zlibstatic PUBLIC ${zlib_SOURCE_DIR})
4040
endif()

0 commit comments

Comments
 (0)