We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7a52fe commit 8c77294Copy full SHA for 8c77294
CMakeLists.txt
@@ -187,10 +187,17 @@ else()
187
endif()
188
189
if(WITH_ZSTD)
190
- find_package(zstd REQUIRED)
+ find_package(zstd CONFIG)
191
+ if(zstd_DIR)
192
+ # Extract include dirs, because some targets (testutillib) use zstd headers without linking to zstd.
193
+ get_target_property(ZSTD_INCLUDE_DIRS zstd::libzstd INTERFACE_INCLUDE_DIRECTORIES)
194
+ list(APPEND THIRDPARTY_LIBS zstd::libzstd)
195
+ else()
196
+ find_package(zstd REQUIRED)
197
+ list(APPEND THIRDPARTY_LIBS zstd::zstd)
198
+ endif()
199
add_definitions(-DZSTD)
200
include_directories(${ZSTD_INCLUDE_DIRS})
- list(APPEND THIRDPARTY_LIBS zstd::zstd)
201
202
203
0 commit comments