llvm.org GIT mirror llvm / 7b341db
[CMake] Use find_package(LLVM) instead of LLVMConfig This addresses an issues introduced in r362047. Differential Revision: https://reviews.llvm.org/D62640 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362065 91177308-0d34-0410-b5e6-96231b3b80d8 Petr Hosek 3 months ago
1 changed file(s) with 2 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
5858 cmake_minimum_required(VERSION 3.4.3)
5959 project(Runtimes C CXX ASM)
6060
61 find_package(LLVM PATHS "${LLVM_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
62
6163 # Add the root project's CMake modules, and the LLVM build's modules to the
6264 # CMake module path.
6365 list(INSERT CMAKE_MODULE_PATH 0
6466 "${CMAKE_CURRENT_SOURCE_DIR}/../cmake"
6567 "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules"
66 "${LLVM_LIBRARY_DIR}/cmake/llvm"
6768 )
6869
6970 # Some of the runtimes will conditionally use the compiler-rt sanitizers
7879 endif()
7980 endif()
8081
81 # LLVMConfig.cmake contains a bunch of CMake variables from the LLVM build.
82 # This file is installed as part of LLVM distributions, so this can be used
83 # either from a build directory or an installed LLVM.
84 include(LLVMConfig)
85
8682 # Setting these variables will allow the sub-build to put their outputs into
8783 # the library and bin directories of the top-level build.
8884 set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_DIR})
8985 set(LLVM_RUNTIME_OUTPUT_INTDIR ${LLVM_TOOLS_BINARY_DIR})
9086
9187 # This variable makes sure that e.g. llvm-lit is found.
92 set(LLVM_BINARY_DIR ${LLVM_BUILD_BINARY_DIR})
93 set(LLVM_LIBRARY_DIR ${LLVM_BUILD_LIBRARY_DIR})
94 set(LLVM_INCLUDE_DIR ${LLVM_BUILD_MAIN_INCLUDE_DIR})
9588 set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR})
9689 set(LLVM_CMAKE_PATH ${LLVM_MAIN_SRC_DIR}/cmake/modules)
9790