summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Callahan <dcallahan@fb.com>2018-11-29 14:57:14 +0000
committerDavid Callahan <dcallahan@fb.com>2018-11-29 14:57:14 +0000
commit8aa500e3488e555394c81237643f3dc244c9ba37 (patch)
treee56408118b5d849616b0348841a33311bbc1806b /CMakeLists.txt
parentae8cfe3c9cfa888718d0f9d1816e08b16f3c37ec (diff)
downloadclang-8aa500e3488e555394c81237643f3dc244c9ba37.tar.gz
inhereit LLVM_ENABLE_LIBXML2
Summary: When building in an LLVM context, we should respect its LLVM_ENABLE_LIBXML2 option. Reviewers: vitalybuka, mspertus, modocache Reviewed By: modocache Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D53212 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt17
1 files changed, 10 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9af43440b4..c2016a45ca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -103,6 +103,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
option(LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN
"Set to ON to force using an old, unsupported host toolchain." OFF)
option(CLANG_ENABLE_BOOTSTRAP "Generate the clang bootstrap target" OFF)
+ option(LLVM_ENABLE_LIBXML2 "Use libxml2 if available." ON)
include(AddLLVM)
include(TableGen)
@@ -198,13 +199,15 @@ endif()
# we can include cmake files from this directory.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
-# Don't look for libxml if we're using MSan, since uninstrumented third party
-# code may call MSan interceptors like strlen, leading to false positives.
-if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
- set (LIBXML2_FOUND 0)
- find_package(LibXml2 2.5.3 QUIET)
- if (LIBXML2_FOUND)
- set(CLANG_HAVE_LIBXML 1)
+if(LLVM_ENABLE_LIBXML2)
+ # Don't look for libxml if we're using MSan, since uninstrumented third party
+ # code may call MSan interceptors like strlen, leading to false positives.
+ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
+ set (LIBXML2_FOUND 0)
+ find_package(LibXml2 2.5.3 QUIET)
+ if (LIBXML2_FOUND)
+ set(CLANG_HAVE_LIBXML 1)
+ endif()
endif()
endif()