r347870 - inhereit LLVM_ENABLE_LIBXML2
David Callahan via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 29 06:57:14 PST 2018
Author: david2050
Date: Thu Nov 29 06:57:14 2018
New Revision: 347870
URL: http://llvm.org/viewvc/llvm-project?rev=347870&view=rev
Log:
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
Modified:
cfe/trunk/CMakeLists.txt
Modified: cfe/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=347870&r1=347869&r2=347870&view=diff
==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Thu Nov 29 06:57:14 2018
@@ -103,6 +103,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
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()
More information about the cfe-commits
mailing list