diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -79,7 +79,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED YES) set(CMAKE_CXX_EXTENSIONS NO) - load_llvm_config() + if (NOT LLVM_RUNTIMES_BUILD) + load_llvm_config() + endif() if (TARGET intrinsics_gen) # Loading the llvm config causes this target to be imported so place it # under the appropriate folder in an IDE. diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -25,7 +25,9 @@ include(base-config-ix) include(CompilerRTUtils) - load_llvm_config() + if (NOT LLVM_RUNTIMES_BUILD) + load_llvm_config() + endif() construct_compiler_rt_default_triple() include(SetPlatformToolchainTools) diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -54,6 +54,7 @@ endif() if (NOT LLVM_FOUND) set(LLVM_TOOLS_BINARY_DIR ${LLVM_BINARY_DIR}/bin) + set(LLVM_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/include) set(LLVM_LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/lib) endif()