summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2019-05-30 07:34:39 +0000
committerPetr Hosek <phosek@chromium.org>2019-05-30 07:34:39 +0000
commit433a19168379cc87c7ea4ee8dbdca5b76f2e4b30 (patch)
treeef37a56d02b56fe78e0549e80ba2f633031e58dc
parentde234847e9dbc26d8b3377871fde3943c6fb309f (diff)
downloadbcm5719-llvm-433a19168379cc87c7ea4ee8dbdca5b76f2e4b30.tar.gz
bcm5719-llvm-433a19168379cc87c7ea4ee8dbdca5b76f2e4b30.zip
[CMake] Use find_package(LLVM) instead of LLVMConfig
This addresses an issues introduced in r362047. Differential Revision: https://reviews.llvm.org/D62640 llvm-svn: 362065
-rw-r--r--libunwind/CMakeLists.txt2
-rw-r--r--llvm/runtimes/CMakeLists.txt11
2 files changed, 3 insertions, 10 deletions
diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index 16bfb9a8202..b51922a48fe 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -15,7 +15,7 @@ set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
)
-if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBUNWIND_STANDALONE_BUILD)
project(libunwind)
# Rely on llvm-config.
diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index b9531daa4ab..e91003b5b19 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -59,12 +59,13 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
cmake_minimum_required(VERSION 3.4.3)
project(Runtimes C CXX ASM)
+ find_package(LLVM PATHS "${LLVM_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+
# Add the root project's CMake modules, and the LLVM build's modules to the
# CMake module path.
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/../cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules"
- "${LLVM_LIBRARY_DIR}/cmake/llvm"
)
# Some of the runtimes will conditionally use the compiler-rt sanitizers
@@ -79,20 +80,12 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
endif()
endif()
- # LLVMConfig.cmake contains a bunch of CMake variables from the LLVM build.
- # This file is installed as part of LLVM distributions, so this can be used
- # either from a build directory or an installed LLVM.
- include(LLVMConfig)
-
# Setting these variables will allow the sub-build to put their outputs into
# the library and bin directories of the top-level build.
set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_DIR})
set(LLVM_RUNTIME_OUTPUT_INTDIR ${LLVM_TOOLS_BINARY_DIR})
# This variable makes sure that e.g. llvm-lit is found.
- set(LLVM_BINARY_DIR ${LLVM_BUILD_BINARY_DIR})
- set(LLVM_LIBRARY_DIR ${LLVM_BUILD_LIBRARY_DIR})
- set(LLVM_INCLUDE_DIR ${LLVM_BUILD_MAIN_INCLUDE_DIR})
set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR})
set(LLVM_CMAKE_PATH ${LLVM_MAIN_SRC_DIR}/cmake/modules)
OpenPOWER on IntegriCloud