From 9bc1ece6170a830dc211366bd66eb98d5dd3b875 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Tue, 29 Oct 2024 15:57:59 -0700 Subject: [PATCH] Fail if LLVM_ENABLE_ZSTD is FORCE_ON --- llvm/cmake/config-ix.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index 03a532772cbfe..6375280e03b38 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -161,6 +161,10 @@ endif() # If LLVM_USE_STATIC_ZSTD is specified, make sure we enable zstd only if static # libraries are found. if(LLVM_USE_STATIC_ZSTD AND NOT TARGET zstd::libzstd_static) + # Fail if LLVM_ENABLE_ZSTD is FORCE_ON. + if(LLVM_ENABLE_ZSTD STREQUAL FORCE_ON) + message(FATAL_ERROR "Failed to find static zstd libraries, but LLVM_USE_STATIC_ZSTD=ON and LLVM_ENABLE_ZSTD=FORCE_ON.") + endif() set(LLVM_ENABLE_ZSTD OFF) else() set(LLVM_ENABLE_ZSTD ${zstd_FOUND})