diff options
author | Chris Bieneman <chris.bieneman@me.com> | 2019-05-24 16:21:38 +0000 |
---|---|---|
committer | Chris Bieneman <chris.bieneman@me.com> | 2019-05-24 16:21:38 +0000 |
commit | 668b968f6dfecdfaab764f5b816266837be5f63f (patch) | |
tree | b0981a2e118adf6320b40d43f2b96fe13ce15bf9 /runtimes | |
parent | 6a29119c95912c0c2d7868424bbe3419bce1588e (diff) | |
download | llvm-668b968f6dfecdfaab764f5b816266837be5f63f.tar.gz |
[CMake] Fix issues building runtimes
This resolves two issues:
(1) LIBCXX_HEADER_DIR is a very misleadingly named variable because it shouldn't be set to the header directory, instead it needs to be the root binary dir.
(2) If you build runtimes without libcxx, we can't depend on the libcxx header target, so we should instaed refer to it by the variable name which will be unset if libcxx isn't present.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361646 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtimes')
-rw-r--r-- | runtimes/CMakeLists.txt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt index 9016efe600e7..acf4f3e3e57a 100644 --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -210,7 +210,9 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) else() # if this is included from LLVM's CMake include(LLVMExternalProjectUtils) if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR AND "libcxx" IN_LIST LLVM_ENABLE_RUNTIMES) - set(LIBCXX_HEADER_DIR ${LLVM_INCLUDE_DIR}/c++/v1/) + # This looks wrong, but libcxx's build actually wants the header dir to be + # the root build dir, not the include directory. + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) set(CXX_HEADER_TARGET runtime-libcxx-headers) add_subdirectory(${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}/include ${CXX_HEADER_TARGET}) endif() @@ -363,7 +365,7 @@ else() # if this is included from LLVM's CMake llvm_ExternalProject_Add(runtimes ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${ARG_DEPENDS} runtime-libcxx-headers + DEPENDS ${ARG_DEPENDS} ${CXX_HEADER_TARGET} # Builtins were built separately above CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} @@ -454,7 +456,7 @@ else() # if this is included from LLVM's CMake llvm_ExternalProject_Add(runtimes-${name} ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${${name}_deps} runtime-libcxx-headers + DEPENDS ${${name}_deps} ${CXX_HEADER_TARGET} # Builtins were built separately above CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} |