[PATCH] D53212: inhereit LLVM_ENABLE_LIBXML2
David Callahan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 12 13:10:31 PDT 2018
david2050 created this revision.
Herald added subscribers: cfe-commits, mgorny.
When building in an LLVM context, we should respect its LLVM_ENABLE_LIBXML2 option.
Repository:
rC Clang
https://reviews.llvm.org/D53212
Files:
CMakeLists.txt
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -89,6 +89,7 @@
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_LIBXM2 "Use libxml2 if available." ON)
include(AddLLVM)
include(TableGen)
@@ -184,13 +185,15 @@
# 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()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53212.169480.patch
Type: text/x-patch
Size: 1300 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181012/d42f8e81/attachment.bin>
More information about the cfe-commits
mailing list