Passthrough generator flags

This commit is contained in:
Georg Hagen
2024-06-24 17:46:26 +02:00
parent a5f93684c7
commit 031fc52011
6 changed files with 14 additions and 10 deletions

View File

@@ -8,20 +8,19 @@ if (NOT DEFINED LibArchive_LIBRARIES)
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/deps
)
execute_process(
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}/deps
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}/deps --config Release
RESULT_VARIABLE build_result
)
if (NOT ${build_result} EQUAL "0")
message(FATAL_ERROR "Failed to build lib archive!")
endif()
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/deps/INSTALL)
else ()
message("Using system LibArchive")
set(USING_SYSTEM_LIBARCHIVE ON PARENT_SCOPE)
endif ()
function(LinkLibArchive TARGET)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/deps/INSTALL)
find_package(LibArchive REQUIRED)
set(ZLIB_USE_STATIC_LIBS ON)
find_package(ZLIB REQUIRED)