diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-14 15:39:13 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-14 15:39:13 +0000 |
commit | fd857c8184809f0fac54f7ec9d9e91477beb1b7d (patch) | |
tree | 58ed2d52992ba3dcfcc9e34d35ab3ed8b7aa76ed /cmake | |
parent | 78da6db1f23c0bfe8a36a5b5c05d06005037e556 (diff) | |
download | src-test2-fd857c8184809f0fac54f7ec9d9e91477beb1b7d.tar.gz src-test2-fd857c8184809f0fac54f7ec9d9e91477beb1b7d.zip |
Notes
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/HandleOutOfTreeLLVM.cmake | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cmake/Modules/HandleOutOfTreeLLVM.cmake b/cmake/Modules/HandleOutOfTreeLLVM.cmake index c772143244ae..7fee839d2732 100644 --- a/cmake/Modules/HandleOutOfTreeLLVM.cmake +++ b/cmake/Modules/HandleOutOfTreeLLVM.cmake @@ -38,7 +38,18 @@ macro(find_llvm_parts) set(LLVM_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include") set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree") set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree") - set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") + + # --cmakedir is supported since llvm r291218 (4.0 release) + execute_process( + COMMAND ${LLVM_CONFIG_PATH} --cmakedir + RESULT_VARIABLE HAD_ERROR + OUTPUT_VARIABLE CONFIG_OUTPUT) + if(NOT HAD_ERROR) + string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH) + else() + set(LLVM_CMAKE_PATH + "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") + endif() else() set(LLVM_FOUND OFF) message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: " |