summaryrefslogtreecommitdiff
path: root/app-arch/libdeflate/files/libdeflate-1.19-make-gzip-tests-conditional.patch
blob: ae290f3f69d2a1e4c0e151c2f1e9f5749531ec46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Only build these when the user enables zlib and gzip support
diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt
index e707a25..fcfaf12 100644
--- a/programs/CMakeLists.txt
+++ b/programs/CMakeLists.txt
@@ -80,22 +80,28 @@ if(LIBDEFLATE_BUILD_TESTS)
     target_link_libraries(libdeflate_test_utils PUBLIC
                           libdeflate_prog_utils ZLIB::ZLIB)
 
+    if(LIBDEFLATE_GZIP_SUPPORT AND LIBDEFLATE_ZLIB_SUPPORT)
     # Build the benchmark and checksum programs.
     add_executable(benchmark benchmark.c)
     target_link_libraries(benchmark PRIVATE libdeflate_test_utils)
     add_executable(checksum checksum.c)
     target_link_libraries(checksum PRIVATE libdeflate_test_utils)
+    endif()
 
     # Build the unit test programs and register them with CTest.
     set(UNIT_TEST_PROGS
-        test_checksums
         test_custom_malloc
         test_incomplete_codes
         test_invalid_streams
         test_litrunlen_overflow
         test_overread
         test_slow_decompression
-        test_trailing_bytes
     )
+    if(LIBDEFLATE_GZIP_SUPPORT AND LIBDEFLATE_ZLIB_SUPPORT)
+      list(APPEND UNIT_TEST_PROGS
+        test_checksums
+        test_trailing_bytes
+      )
+    endif()
     foreach(PROG ${UNIT_TEST_PROGS})
         add_executable(${PROG} ${PROG}.c)
         target_link_libraries(${PROG} PRIVATE libdeflate_test_utils)