diff options
author | Vollstrecker <werner@vollstreckernet.de> | 2024-12-05 17:22:17 +0100 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2025-01-31 19:59:10 -0800 |
commit | 155d88378e76b3bf123da4301a5b82aad17d06bc (patch) | |
tree | 7c6757440e42656ce30f842543eff055f6a20430 | |
parent | fd00a948388c9926f6caecdb72bccbfcb0ea29e0 (diff) | |
download | zlib-155d88378e76b3bf123da4301a5b82aad17d06bc.tar.gz zlib-155d88378e76b3bf123da4301a5b82aad17d06bc.tar.bz2 zlib-155d88378e76b3bf123da4301a5b82aad17d06bc.zip |
CMake: Test static builds.
-rw-r--r-- | CMakeLists.txt | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c5ca713..e05b92b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -231,23 +231,46 @@ endif(ZLIB_INSTALL_LIBRARIES) | |||
231 | #============================================================================ | 231 | #============================================================================ |
232 | if(ZLIB_BUILD_TESTING) | 232 | if(ZLIB_BUILD_TESTING) |
233 | enable_testing() | 233 | enable_testing() |
234 | add_executable(zlib_example test/example.c) | 234 | |
235 | target_link_libraries(zlib_example ZLIB::ZLIB) | 235 | if(ZLIB_BUILD_SHARED) |
236 | add_test(zlib_example zlib_example) | 236 | add_executable(zlib_example test/example.c) |
237 | 237 | target_link_libraries(zlib_example ZLIB::ZLIB) | |
238 | add_executable(minigzip test/minigzip.c) | 238 | add_test(zlib_example zlib_example) |
239 | target_link_libraries(minigzip ZLIB::ZLIB) | 239 | |
240 | 240 | add_executable(minigzip test/minigzip.c) | |
241 | if(HAVE_OFF64_T) | 241 | target_link_libraries(minigzip ZLIB::ZLIB) |
242 | add_executable(zlib_example64 test/example.c) | 242 | |
243 | target_compile_definitions(zlib_example64 PRIVATE LARGEFILE64_SOURCE=1) | 243 | if(HAVE_OFF64_T) |
244 | target_link_libraries(zlib_example64 ZLIB::ZLIB) | 244 | add_executable(zlib_example64 test/example.c) |
245 | add_test(zlib_example64 zlib_example64) | 245 | target_compile_definitions(zlib_example64 PRIVATE LARGEFILE64_SOURCE=1) |
246 | 246 | target_link_libraries(zlib_example64 ZLIB::ZLIB) | |
247 | add_executable(minigzip64 test/minigzip.c) | 247 | add_test(zlib_example64 zlib_example64) |
248 | target_compile_definitions(minigzip64 PRIVATE LARGEFILE64_SOURCE=1) | 248 | |
249 | target_link_libraries(minigzip64 ZLIB::ZLIB) | 249 | add_executable(minigzip64 test/minigzip.c) |
250 | endif(HAVE_OFF64_T) | 250 | target_compile_definitions(minigzip64 PRIVATE LARGEFILE64_SOURCE=1) |
251 | target_link_libraries(minigzip64 ZLIB::ZLIB) | ||
252 | endif(HAVE_OFF64_T) | ||
253 | endif(ZLIB_BUILD_SHARED) | ||
254 | |||
255 | if(ZLIB_BUILD_STATIC) | ||
256 | add_executable(zlib_static_example test/example.c) | ||
257 | target_link_libraries(zlib_static_example ZLIB::ZLIBSTATIC) | ||
258 | add_test(zlib_static_example zlib_static_example) | ||
259 | |||
260 | add_executable(static_minigzip test/minigzip.c) | ||
261 | target_link_libraries(static_minigzip ZLIB::ZLIBSTATIC) | ||
262 | |||
263 | if(HAVE_OFF64_T) | ||
264 | add_executable(zlib_static_example64 test/example.c) | ||
265 | target_compile_definitions(zlib_static_example64 PRIVATE LARGEFILE64_SOURCE=1) | ||
266 | target_link_libraries(zlib_static_example64 ZLIB::ZLIBSTATIC) | ||
267 | add_test(zlib_static_example64 zlib_static_example64) | ||
268 | |||
269 | add_executable(static_minigzip64 test/minigzip.c) | ||
270 | target_compile_definitions(static_minigzip64 PRIVATE LARGEFILE64_SOURCE=1) | ||
271 | target_link_libraries(static_minigzip64 ZLIB::ZLIBSTATIC) | ||
272 | endif(HAVE_OFF64_T) | ||
273 | endif(ZLIB_BUILD_STATIC) | ||
251 | 274 | ||
252 | add_subdirectory(test) | 275 | add_subdirectory(test) |
253 | endif(ZLIB_BUILD_TESTING) | 276 | endif(ZLIB_BUILD_TESTING) |