File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,8 +46,10 @@ if(MSVC)
4646 $<$<COMPILE_LANGUAGE :CUDA >:-Xcompiler "/O2 /W4 /Zi ">
4747 )
4848 target_compile_definitions (cupdlpx_compile_flags INTERFACE
49- _CRT_SECURE_NO_WARNINGS
49+ _CRT_SECURE_NO_WARNINGS
50+ _CRT_NONSTDC_NO_DEPRECATE
5051 strtok_r=strtok_s
52+ strdup=_strdup
5153 )
5254else ()
5355 target_compile_options (cupdlpx_compile_flags INTERFACE -O3 -Wall -Wextra -g )
@@ -81,21 +83,24 @@ include(FetchContent)
8183# 1. ZLIB Configuration
8284find_package (ZLIB QUIET )
8385if (NOT ZLIB_FOUND)
84- message (STATUS "ZLIB not found. Fetching from source..." )
8586 FetchContent_Declare (
8687 zlib
8788 GIT_REPOSITORY https://github.com/madler/zlib.git
8889 GIT_TAG v1.3
8990 )
9091 FetchContent_MakeAvailable (zlib)
91- if (NOT TARGET ZLIB::ZLIB)
92- if (TARGET zlibstatic)
93- add_library (ZLIB::ZLIB ALIAS zlibstatic )
94- target_include_directories (zlibstatic INTERFACE ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR} )
95- else ()
96- add_library (ZLIB::ZLIB ALIAS zlib )
97- target_include_directories (zlib INTERFACE ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR} )
92+
93+ if (TARGET zlibstatic)
94+ target_compile_definitions (zlibstatic INTERFACE
95+ $<$<PLATFORM_ID :Windows >:ZLIB_STATIC_LINKING >
96+ )
97+
98+ if (TARGET example)
99+ target_link_libraries (example PRIVATE zlibstatic )
100+ target_compile_definitions (example PRIVATE ZLIB_STATIC_LINKING )
98101 endif ()
102+
103+ add_library (ZLIB::ZLIB ALIAS zlibstatic )
99104 endif ()
100105endif ()
101106
You can’t perform that action at this time.
0 commit comments