Skip to content

Commit

Permalink
CMake: Turn LLVM_ENABLE_LIBXML2 into a tri-state option
Browse files Browse the repository at this point in the history
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.

Differential revision: https://reviews.llvm.org/D40050

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318209 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
zmodem committed Nov 14, 2017
1 parent 0240575 commit e144f87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ set(LLVM_TARGET_ARCH "host"

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)

Expand Down
4 changes: 4 additions & 0 deletions cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ if( NOT PURE_WINDOWS AND NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
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)
Expand Down

0 comments on commit e144f87

Please sign in to comment.