Skip to content
Permalink
Browse files
Merge pull request #9622 from skylersaleh/fix_zstd_headers
Check that zstd headers can be found before using a shared zstd library
  • Loading branch information
leoetlino committed Apr 6, 2021
2 parents e89ae71 + b0d91a5 commit d96874a
Showing 1 changed file with 7 additions and 2 deletions.
@@ -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()

0 comments on commit d96874a

Please sign in to comment.