mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
[CMAKE] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2
On MacOS, if CMAKE_OSX_SYSROOT is used and the user has command line tools
installed, we currently get the include path for libxml2 as
/usr/include/libxml2, instead of ${CMAKE_OSX_SYSROOT}/usr/include/libxml2.
Make it consistent on MacOS by prefixing ${CMAKE_OSX_SYSROOT} when
possible.
rdar://problem/41103601
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334746 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -148,7 +148,11 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
|
||||
find_package(LibXml2)
|
||||
if (LIBXML2_FOUND)
|
||||
set(LLVM_LIBXML2_ENABLED 1)
|
||||
include_directories(${LIBXML2_INCLUDE_DIR})
|
||||
if ((CMAKE_OSX_SYSROOT) AND (EXISTS ${CMAKE_OSX_SYSROOT}/${LIBXML2_INCLUDE_DIR}))
|
||||
include_directories(${CMAKE_OSX_SYSROOT}/${LIBXML2_INCLUDE_DIR})
|
||||
else()
|
||||
include_directories(${LIBXML2_INCLUDE_DIR})
|
||||
endif()
|
||||
set(LIBXML2_LIBS "xml2")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user