Fix libarchive being found on macOS

properly this time
This commit is contained in:
WaluigiWare64 2021-01-04 10:31:57 +00:00 committed by GitHub
parent 9e15488e95
commit 6c91157495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -55,8 +55,10 @@ pkg_check_modules(SDL2 REQUIRED sdl2)
pkg_check_modules(SLIRP REQUIRED slirp)
if (APPLE)
# Find libarchive on macOS, because macOS only provides the library, not the headers
execute_process(COMMAND brew --prefix libarchive
OUTPUT_VARIABLE LIBARCHIVE_DIR)
OUTPUT_VARIABLE LIBARCHIVE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_PREFIX_PATH "${LIBARCHIVE_DIR}/lib/pkgconfig")
endif()
pkg_check_modules(LIBARCHIVE REQUIRED libarchive)