build: fixed issue with clang includes detection (issue #1058) (#1064)

This commit is contained in:
Sergei Nikulov
2020-08-17 10:26:03 +02:00
committed by GitHub
parent cffdf6b57f
commit 8e30c8b633
+11 -1
View File
@@ -138,7 +138,17 @@ if (BUILD_CXX_LANGUAGE_PACKAGE)
set (CLANG_COMPILER_HEADER_SEARCH_PATH "")
foreach(LLVM_CONFIGURATION_TYPE ${LLVM_CONFIGURATION_TYPES})
if (CLANG_COMPILER_HEADER_SEARCH_PATH STREQUAL "")
set (CLANG_COMPILER_HEADER_SEARCH_PATH "${LLVM_BINARY_DIR}/${LLVM_CONFIGURATION_TYPE}/lib/clang/${LLVM_VERSION}/include")
set (_CLANG_HEADERS_SEARCH_LIST
"${LLVM_BINARY_DIR}/${LLVM_CONFIGURATION_TYPE}/lib/clang/${LLVM_VERSION}/include"
"${LLVM_BINARY_DIR}/${LLVM_CONFIGURATION_TYPE}/lib64/clang/${LLVM_VERSION}/include"
)
foreach (_CLANG_HEADER_PATH ${_CLANG_HEADERS_SEARCH_LIST})
if (EXISTS ${_CLANG_HEADER_PATH})
set (CLANG_COMPILER_HEADER_SEARCH_PATH ${_CLANG_HEADER_PATH})
break ()
endif ()
endforeach ()
message (STATUS "Trying to find Clang compiler headers in '${LLVM_CONFIGURATION_TYPE}' build config in directory '${CLANG_COMPILER_HEADER_SEARCH_PATH}'.")
if (EXISTS ${CLANG_COMPILER_HEADER_SEARCH_PATH})
message (STATUS "Found headers for '${LLVM_CONFIGURATION_TYPE}' build config.")