llvm.org GIT mirror llvm / 668b968
[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 Chris Bieneman a month ago
1 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
209209 else() # if this is included from LLVM's CMake
210210 include(LLVMExternalProjectUtils)
211211 if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR AND "libcxx" IN_LIST LLVM_ENABLE_RUNTIMES)
212 set(LIBCXX_HEADER_DIR ${LLVM_INCLUDE_DIR}/c++/v1/)
212 # This looks wrong, but libcxx's build actually wants the header dir to be
213 # the root build dir, not the include directory.
214 set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR})
213215 set(CXX_HEADER_TARGET runtime-libcxx-headers)
214216 add_subdirectory(${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}/include ${CXX_HEADER_TARGET})
215217 endif()
362364
363365 llvm_ExternalProject_Add(runtimes
364366 ${CMAKE_CURRENT_SOURCE_DIR}
365 DEPENDS ${ARG_DEPENDS} runtime-libcxx-headers
367 DEPENDS ${ARG_DEPENDS} ${CXX_HEADER_TARGET}
366368 # Builtins were built separately above
367369 CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
368370 -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
453455
454456 llvm_ExternalProject_Add(runtimes-${name}
455457 ${CMAKE_CURRENT_SOURCE_DIR}
456 DEPENDS ${${name}_deps} runtime-libcxx-headers
458 DEPENDS ${${name}_deps} ${CXX_HEADER_TARGET}
457459 # Builtins were built separately above
458460 CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
459461 -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}