[PATCH] D40050: CMake: Turn LLVM_ENABLE_LIBXML2 into a tri-state option
Hans Wennborg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 14 14:21:55 PST 2017
hans created this revision.
Herald added a subscriber: mgorny.
In addition to the current ON and OFF options, this adds the FORCE_ON
option, which causes a configuration error if libxml2 cannot be used.
https://reviews.llvm.org/D40050
Files:
CMakeLists.txt
cmake/config-ix.cmake
Index: cmake/config-ix.cmake
===================================================================
--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -170,6 +170,10 @@
endif()
endif()
+if (LLVM_ENABLE_LIBXML2 STREQUAL "FORCE_ON" AND NOT LLVM_LIBXML2_ENABLED)
+ message(FATAL_ERROR "Failed to congifure libxml2")
+endif()
+
check_library_exists(xar xar_open "" HAVE_LIBXAR)
if(HAVE_LIBXAR)
set(XAR_LIB xar)
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -347,7 +347,7 @@
option(LLVM_ENABLE_TERMINFO "Use terminfo database if available." ON)
-option(LLVM_ENABLE_LIBXML2 "Use libxml2 if available." ON)
+set(LLVM_ENABLE_LIBXML2 "ON" CACHE STRING "Use libxml2 if available. Can be ON, OFF, or FORCE_ON")
option(LLVM_ENABLE_LIBEDIT "Use libedit if available." ON)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40050.122913.patch
Type: text/x-patch
Size: 867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171114/cfa8c6e3/attachment.bin>
More information about the llvm-commits
mailing list