File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -195,8 +195,19 @@ if(LLVM_ENABLE_ZSTD)
195195 elseif (NOT LLVM_USE_SANITIZER MATCHES "Memory.*" )
196196 find_package (zstd QUIET )
197197 endif ()
198+
199+ # If LLVM_USE_STATIC_ZSTD is specified, make sure we enable zstd only if static
200+ # libraries are found.
201+ if (LLVM_USE_STATIC_ZSTD AND NOT TARGET zstd::libzstd_static)
202+ # Fail if LLVM_ENABLE_ZSTD is FORCE_ON.
203+ if (LLVM_ENABLE_ZSTD STREQUAL FORCE_ON)
204+ message (FATAL_ERROR "Failed to find static zstd libraries, but LLVM_USE_STATIC_ZSTD=ON and LLVM_ENABLE_ZSTD=FORCE_ON." )
205+ endif ()
206+ set (LLVM_ENABLE_ZSTD OFF )
207+ else ()
208+ set (LLVM_ENABLE_ZSTD ${zstd_FOUND} )
209+ endif ()
198210endif ()
199- set (LLVM_ENABLE_ZSTD ${zstd_FOUND} )
200211
201212if (LLVM_ENABLE_LIBXML2)
202213 if (LLVM_ENABLE_LIBXML2 STREQUAL FORCE_ON)
You can’t perform that action at this time.
0 commit comments