File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -228,9 +228,11 @@ set(ARCHIVE_BUILD_STATIC_LIBS ON CACHE BOOL "")
228228set (ARCHIVE_BUILD_EXAMPLES OFF CACHE BOOL "" )
229229set (ENABLE_ZSTD ON CACHE BOOL "" )
230230set (ENABLE_LZMA ON CACHE BOOL "" )
231- # Point libarchive to our bundled LZMA
232- set (LIBLZMA_INCLUDE_DIR ${xz_SOURCE_DIR} /src/liblzma/api CACHE PATH "LZMA include for libarchive" )
233- set (LIBLZMA_LIBRARY liblzma CACHE STRING "LZMA library for libarchive" )
231+ # Point libarchive to our bundled LZMA - prevent finding system LZMA
232+ set (LIBLZMA_FOUND true CACHE BOOL "Force LibArchive to use our bundled LZMA" FORCE )
233+ set (LIBLZMA_INCLUDE_DIR ${xz_SOURCE_DIR} /src/liblzma/api CACHE PATH "LZMA include for libarchive" FORCE )
234+ set (LIBLZMA_LIBRARY liblzma CACHE STRING "LZMA library for libarchive" FORCE )
235+ set (LIBLZMA_LIBRARIES liblzma CACHE STRING "LZMA libraries for libarchive" FORCE )
234236set (POSIX_REGEX_LIB "libc" CACHE STRING "Regex library for libarchive" )
235237set (LIBARCHIVE_VERSION "3.8.1" )
236238
@@ -246,10 +248,13 @@ if(TARGET archive_static AND NOT TARGET LibArchive::archive_static)
246248 add_library (LibArchive::archive_static ALIAS archive_static )
247249endif ()
248250
249- # Ensure libarchive is built after zlib
251+ # Ensure libarchive is built after its dependencies
250252if (TARGET archive_static AND TARGET ZLIB::ZLIB)
251253 add_dependencies (archive_static ZLIB::ZLIB )
252254endif ()
255+ if (TARGET archive_static AND TARGET liblzma)
256+ add_dependencies (archive_static liblzma )
257+ endif ()
253258
254259unset (POSIX_REGEX_LIB)
255260unset (ENABLE_WERROR)
You can’t perform that action at this time.
0 commit comments