Skip to content

Commit 4add105

Browse files
[LLVM] Fail if LLVM_ENABLE_ZSTD is FORCE_ON but static zstd libraries are not found (#15924)
Currently, if we pass `LLVM_USE_STATIC_ZSTD=ON` and `LLVM_ENABLE_ZSTD=FORCE_ON`, we silently ignore zstd and proceed to build the compiler. With `LLVM_ENABLE_ZSTD=FORCE_ON`, we should throw an error instead. Thanks @tcreech-intel for find this.
1 parent 7116e9d commit 4add105

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/cmake/config-ix.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ endif()
161161
# If LLVM_USE_STATIC_ZSTD is specified, make sure we enable zstd only if static
162162
# libraries are found.
163163
if(LLVM_USE_STATIC_ZSTD AND NOT TARGET zstd::libzstd_static)
164+
# Fail if LLVM_ENABLE_ZSTD is FORCE_ON.
165+
if(LLVM_ENABLE_ZSTD STREQUAL FORCE_ON)
166+
message(FATAL_ERROR "Failed to find static zstd libraries, but LLVM_USE_STATIC_ZSTD=ON and LLVM_ENABLE_ZSTD=FORCE_ON.")
167+
endif()
164168
set(LLVM_ENABLE_ZSTD OFF)
165169
else()
166170
set(LLVM_ENABLE_ZSTD ${zstd_FOUND})

0 commit comments

Comments
 (0)