summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorRodolfo Lima <rlima@nvidia.com>2021-01-24 16:03:50 (GMT)
committerRodolfo Lima <rlima@nvidia.com>2021-01-26 15:23:37 (GMT)
commitbcdb5b52a06cb98bd09da7410488ff9d5617b27f (patch)
tree9c87d8ccd32553141dedc5e8a6031526ae937cdf /Utilities
parent1380e611e1248c7bfe3889a4f00840c1a5a41d03 (diff)
downloadCMake-bcdb5b52a06cb98bd09da7410488ff9d5617b27f.zip
CMake-bcdb5b52a06cb98bd09da7410488ff9d5617b27f.tar.gz
CMake-bcdb5b52a06cb98bd09da7410488ff9d5617b27f.tar.bz2
libarchive: Fix lzma_stream_encoder_mt detection
The test for lzma_stream_encoder_mt was always failing because the lzma libraries weren't being used by linker.
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibarchive/CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
index bfcaf30..6d6c1fb 100644
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -1475,9 +1475,15 @@ CHECK_C_SOURCE_COMPILES(
"#include <sys/sysmacros.h>\nint main() { return major(256); }"
MAJOR_IN_SYSMACROS)
+CMAKE_PUSH_CHECK_STATE()
+SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES})
+SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR})
+
CHECK_C_SOURCE_COMPILES(
"#include <lzma.h>\n#if LZMA_VERSION < 50020000\n#error unsupported\n#endif\nint main(void){lzma_stream_encoder_mt(0, 0); return 0;}"
- HAVE_LZMA_STREAM_ENCODER_MT)
+HAVE_LZMA_STREAM_ENCODER_MT)
+
+CMAKE_POP_CHECK_STATE()
IF(HAVE_STRERROR_R)
SET(HAVE_DECL_STRERROR_R 1)