diff options
| author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2018-06-14 18:20:04 +0000 |
|---|---|---|
| committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2018-06-14 18:20:04 +0000 |
| commit | f56ef90e26bd1bb5cfa8e4b0e09ec56a9142dbfb (patch) | |
| tree | a98b3bd1d03b8dd3c8aa409ffcb8f22f3745eab5 | |
| parent | 7e8508822ffc0d8d0ace5db684258df37f4cf6c0 (diff) | |
| download | bcm5719-llvm-f56ef90e26bd1bb5cfa8e4b0e09ec56a9142dbfb.tar.gz bcm5719-llvm-f56ef90e26bd1bb5cfa8e4b0e09ec56a9142dbfb.zip | |
[CMAKE][c-index-test] 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
llvm-svn: 334747
| -rw-r--r-- | clang/tools/c-index-test/CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/tools/c-index-test/CMakeLists.txt b/clang/tools/c-index-test/CMakeLists.txt index d38c7bb2870..53e3421f1b3 100644 --- a/clang/tools/c-index-test/CMakeLists.txt +++ b/clang/tools/c-index-test/CMakeLists.txt @@ -40,7 +40,11 @@ set_target_properties(c-index-test # If libxml2 is available, make it available for c-index-test. if (CLANG_HAVE_LIBXML) - include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR}) + if ((CMAKE_OSX_SYSROOT) AND (EXISTS ${CMAKE_OSX_SYSROOT}/${LIBXML2_INCLUDE_DIR})) + include_directories(SYSTEM ${CMAKE_OSX_SYSROOT}/${LIBXML2_INCLUDE_DIR}) + else() + include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR}) + endif() target_link_libraries(c-index-test PRIVATE ${LIBXML2_LIBRARIES}) endif() |

