From 7e041d6dac7489735915ff1879992dc25cb365bc Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Thu, 30 May 2019 01:24:31 +0000 Subject: [PATCH] [CMake] Set LLVM_PATH in the runtimes build This avoids using llvm-config for inferring various paths within the runtimes build. We also set LLVM_INCLUDE_DIR variable that's used by these builds and move assignment of LLVM_BINARY_DIR and LLVM_LIBRARY_DIR to the same location for consistency. Differential Revision: https://reviews.llvm.org/D62637 llvm-svn: 362047 --- llvm/runtimes/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt index 51ad2371..b9531da 100644 --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -90,9 +90,15 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_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) + # This variable is used by individual runtimes to locate LLVM files. + set(LLVM_PATH ${LLVM_BUILD_MAIN_SRC_DIR}) + if(APPLE) set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "") endif() @@ -375,8 +381,6 @@ else() # if this is included from LLVM's CMake # Builtins were built separately above CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} - -DLLVM_BINARY_DIR=${LLVM_BINARY_DIR} - -DLLVM_LIBRARY_DIR=${LLVM_LIBRARY_DIR} -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_TRIPLE} -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DCMAKE_C_COMPILER_TARGET=${TARGET_TRIPLE} @@ -466,8 +470,6 @@ else() # if this is included from LLVM's CMake # Builtins were built separately above CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} - -DLLVM_BINARY_DIR=${LLVM_BINARY_DIR} - -DLLVM_LIBRARY_DIR=${LLVM_LIBRARY_DIR} -DLLVM_DEFAULT_TARGET_TRIPLE=${target} -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DCMAKE_C_COMPILER_TARGET=${target} -- 2.7.4