[llvm] 9a349d6 - CMake: Turn LLVM_ENABLE_ZLIB into a tri-state option
Amy Huang via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 13 13:55:15 PDT 2020
Author: Amy Huang
Date: 2020-03-13T13:52:46-07:00
New Revision: 9a349d66c91884943f60fd472d84b024bb7993c6
URL: https://github.com/llvm/llvm-project/commit/9a349d66c91884943f60fd472d84b024bb7993c6
DIFF: https://github.com/llvm/llvm-project/commit/9a349d66c91884943f60fd472d84b024bb7993c6.diff
LOG: CMake: Turn LLVM_ENABLE_ZLIB into a tri-state option
Summary:
Add FORCE_ON option to LLVM_ENABLE_ZLIB, which causes a configuration
error if zlib is not found.
Similar to https://reviews.llvm.org/D40050.
Reviewers: hans, thakis, rnk
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76110
Added:
Modified:
llvm/CMakeLists.txt
llvm/cmake/config-ix.cmake
Removed:
################################################################################
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 0da3302425c7..23f36d5039a7 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -348,7 +348,7 @@ option(LLVM_ENABLE_LIBPFM "Use libpfm for performance counters if available." ON
option(LLVM_ENABLE_THREADS "Use threads if available." ON)
-option(LLVM_ENABLE_ZLIB "Use zlib for compression/decompression if available." ON)
+set(LLVM_ENABLE_ZLIB "ON" CACHE STRING "Use zlib for compression/decompression if available. Can be ON, OFF, or FORCE_ON")
set(LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.")
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index f758366bc79d..612ce5bdbcbe 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -175,6 +175,10 @@ if (LLVM_ENABLE_LIBXML2 STREQUAL "FORCE_ON" AND NOT LLVM_LIBXML2_ENABLED)
message(FATAL_ERROR "Failed to congifure libxml2")
endif()
+if (LLVM_ENABLE_ZLIB STREQUAL "FORCE_ON" AND NOT HAVE_LIBZ)
+ message(FATAL_ERROR "Failed to configure zlib")
+endif()
+
check_library_exists(xar xar_open "" HAVE_LIBXAR)
if(HAVE_LIBXAR)
set(XAR_LIB xar)
More information about the llvm-commits
mailing list