aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVollstrecker <werner@vollstreckernet.de>2024-12-22 16:10:22 +0100
committerMark Adler <madler@alumni.caltech.edu>2025-01-31 19:59:10 -0800
commit5163cb6d3bd6fa72d7be7213f786455778a5e8f7 (patch)
tree798beb45bea06705fc11bba47fada136232169da /CMakeLists.txt
parent99d41ee5c6acdf67e0271bcac060e31adf7c52e5 (diff)
downloadzlib-5163cb6d3bd6fa72d7be7213f786455778a5e8f7.tar.gz
zlib-5163cb6d3bd6fa72d7be7213f786455778a5e8f7.tar.bz2
zlib-5163cb6d3bd6fa72d7be7213f786455778a5e8f7.zip
CMake: Move testing into test/CMakeLists.txt.
Use the right environment to find the libraries.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt49
1 files changed, 0 insertions, 49 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 65aef14..81943b9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -287,55 +287,6 @@ endif(ZLIB_INSTALL_LIBRARIES)
287#============================================================================ 287#============================================================================
288if(ZLIB_BUILD_TESTING) 288if(ZLIB_BUILD_TESTING)
289 enable_testing() 289 enable_testing()
290
291 if(ZLIB_BUILD_SHARED)
292 add_executable(zlib_example test/example.c)
293 target_link_libraries(zlib_example ZLIB::ZLIB)
294 add_test(NAME zlib_example
295 COMMAND zlib_example)
296
297 add_executable(minigzip test/minigzip.c)
298 target_compile_definitions(zlib
299 PRIVATE
300 $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
301 target_link_libraries(minigzip ZLIB::ZLIB)
302
303 if(HAVE_OFF64_T)
304 add_executable(zlib_example64 test/example.c)
305 target_compile_definitions(zlib_example64
306 PRIVATE
307 LARGEFILE64_SOURCE=1
308 $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
309 target_link_libraries(zlib_example64 ZLIB::ZLIB)
310 add_test(NAME zlib_example64
311 COMMAND zlib_example64)
312 endif(HAVE_OFF64_T)
313 endif(ZLIB_BUILD_SHARED)
314
315 if(ZLIB_BUILD_STATIC)
316 add_executable(zlib_static_example test/example.c)
317 target_link_libraries(zlib_static_example ZLIB::ZLIBSTATIC)
318 target_compile_definitions(zlib_static_example
319 PRIVATE
320 $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
321 add_test(NAME zlib_static_example
322 COMMAND zlib_static_example)
323
324 add_executable(static_minigzip test/minigzip.c)
325 target_link_libraries(static_minigzip ZLIB::ZLIBSTATIC)
326
327 if(HAVE_OFF64_T)
328 add_executable(zlib_static_example64 test/example.c)
329 target_compile_definitions(zlib_static_example64
330 PRIVATE
331 LARGEFILE64_SOURCE=1
332 $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
333 target_link_libraries(zlib_static_example64 ZLIB::ZLIBSTATIC)
334 add_test(NAME zlib_static_example64
335 COMMAND zlib_static_example64)
336 endif(HAVE_OFF64_T)
337 endif(ZLIB_BUILD_STATIC)
338
339 add_subdirectory(test) 290 add_subdirectory(test)
340endif(ZLIB_BUILD_TESTING) 291endif(ZLIB_BUILD_TESTING)
341 292