From b0d91a53990ebdba021a5052d42067f26f2efe0d Mon Sep 17 00:00:00 2001 From: Skyler Saleh Date: Fri, 2 Apr 2021 11:11:14 -0700 Subject: [PATCH] Build: Check for zstd headers Modify the CMakeLists.txt so that it doesn't try to use a shared zstd library that doesn't have header files. This was a support issue on Macs because homebrew was installing headerless zstd libraries with Qt. --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8472e3f98f..df97554d3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -615,11 +615,16 @@ else() endif() pkg_check_modules(ZSTD QUIET libzstd>=1.4.0) -if(ZSTD_FOUND) +check_include_file(zstd.h HAVE_ZSTD_H) +if(ZSTD_FOUND AND HAVE_ZSTD_H) message(STATUS "Using shared zstd version: " ${ZSTD_VERSION}) else() check_vendoring_approved(zstd) - message(STATUS "Shared zstd not found, falling back to the static library") + if(ZSTD_FOUND AND NOT HAVE_ZSTD_H) + message(STATUS "Shared zstd found but lacks headers, falling back to the static library") + else() + message(STATUS "Shared zstd not found, falling back to the static library") + endif() add_subdirectory(Externals/zstd) endif()