diff --git a/CMakeLists.txt b/CMakeLists.txt index 5261d0e..e8ae993 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,9 +148,19 @@ if (NOT APPLE) endif() find_package(HDF5 1.8.16) -find_package(zstd 1.3.1 REQUIRED) find_package(Sanitizers) +# We need CONFIG on macOS to avoid linking to brew. This also changes +# the name of the target. +if (APPLE) + find_package(zstd 1.3.1 REQUIRED CONFIG) + set(zstd_target zstd::libzstd_static) + set(ZSTD_LIBRARY $) +else() + find_package(zstd 1.3.1 REQUIRED) + set(zstd_target zstd::zstd) +endif() + get_filename_component(STREAMVBYTE_SOURCE_DIR third_party/streamvbyte ABSOLUTE diff --git a/vbz/CMakeLists.txt b/vbz/CMakeLists.txt index 9e9de5d..ab53741 100644 --- a/vbz/CMakeLists.txt +++ b/vbz/CMakeLists.txt @@ -41,7 +41,7 @@ endif() target_link_libraries(vbz PUBLIC ${STREAMVBYTE_STATIC_LIB} - zstd::zstd + ${zstd_target} ) if (BUILD_TESTING)