aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2024-03-09 09:49:55 +0800
committerJia Tan <jiat0218@gmail.com>2024-03-09 09:49:55 +0800
commitb93a8d7631d9517da63f03e0185455024a4609e8 (patch)
tree01687e6c34addcc79a32a05d6fb1ec74d6ca102d /CMakeLists.txt
parentliblzma: Fix false Valgrind error report with GCC. (diff)
downloadxz-b93a8d7631d9517da63f03e0185455024a4609e8.tar.xz
Tests: Replace HAVE_MICROLZMA usage in CMake and Autotools builds.
This reverts commit adaacafde6661496ca2814b1e94a3ba5186428cb.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 10 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3b616b5c..a346dd02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -853,10 +853,6 @@ if(MICROLZMA_DECODER)
target_sources(liblzma PRIVATE src/liblzma/common/microlzma_decoder.c)
endif()
-if (MICROLZMA_ENCODER OR MICROLZMA_DECODER)
- add_compile_definitions(HAVE_MICROLZMA)
-endif()
-
#############################
# lzip (.lz) format support #
@@ -2044,11 +2040,20 @@ if(BUILD_TESTING)
test_index_hash
test_lzip_decoder
test_memlimit
- test_microlzma
test_stream_flags
test_vli
)
+ # MicroLZMA encoder is needed for both encoder and decoder tests.
+ # If MicroLZMA decoder is not configured but LZMA1 decoder is, then
+ # test_microlzma will fail to compile because this configuration is
+ # not possible in the Autotools build, so the test was not made to
+ # support it since it would have required additional changes.
+ if (MICROLZMA_ENCODER AND (MICROLZMA_DECODER
+ OR NOT "lzma1" IN_LIST DECODERS))
+ list(APPEND LIBLZMA_TESTS test_microlzma)
+ endif()
+
foreach(TEST IN LISTS LIBLZMA_TESTS)
add_executable("${TEST}" "tests/${TEST}.c")