File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -215,10 +215,19 @@ if (WITH_ZSTD)
215
215
set (ZSTD_LIB_RELEASE $ENV {ZSTD_LIB_RELEASE })
216
216
endif ()
217
217
218
+ if (ZSTD_INCLUDE AND EXISTS "${ZSTD_INCLUDE} " )
219
+ set (ZSTD_LIBS debug ${ZSTD_LIB_DEBUG} optimized ${ZSTD_LIB_RELEASE} )
220
+ else ()
221
+ # No explicit paths provided - try to find config package.
222
+ find_package (zstd CONFIG REQUIRED )
223
+ message (STATUS "zstd: found config at '${zstd_DIR} '." )
224
+ set (ZSTD_LIBS zstd ::libzstd_static )
225
+ # Extract include dirs, because some targets (testutillib) use zstd headers without linking to zstd.
226
+ get_target_property (ZSTD_INCLUDE zstd ::libzstd_static INTERFACE_INCLUDE_DIRECTORIES )
227
+ endif ()
228
+
218
229
# ZSTD_STATIC_LINKING_ONLY only allows us to create an allocation functions override
219
230
# When jemalloc is in use
220
- set (ZSTD_LIBS debug ${ZSTD_LIB_DEBUG} optimized ${ZSTD_LIB_RELEASE} )
221
-
222
231
add_definitions (-DZSTD -DZSTD_STATIC_LINKING_ONLY )
223
232
include_directories (${ZSTD_INCLUDE} )
224
233
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${ZSTD_LIBS} )
You can’t perform that action at this time.
0 commit comments