llvm.org GIT mirror llvm / 4e25386
[CMake] Copy C++ headers before configuring runtimes build Summary: On some platforms C++ headers are packaged with the compiler not the sysroot. If you don't copy C++ headers into the build include directory during configuraiton of the outer build the C++ check during the runtime configuration may get inaccurate results. Reviewers: phosek, compnerd, smeenai, EricWF Reviewed By: compnerd Subscribers: EricWF, christof, libcxx-commits, mgorny, llvm-commits Tags: #llvm, #libc Differential Revision: https://reviews.llvm.org/D62155 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361513 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Bieneman 3 months ago
1 changed file(s) with 13 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
33 # should be built with the LLVM toolchain from the build directory. This file is
44 # a first step to formalizing runtime build interfaces.
55
6 # In the current state this file only works with compiler-rt, other runtimes
7 # will work as the runtime build interface standardizes.
6 # Setting CMake minimum required version should be at the very top of the file
7 # if this is the entry point.
8 if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
9 cmake_minimum_required(VERSION 3.4.3)
10 project(Runtimes C CXX ASM)
11 endif()
812
913 # Find all subdirectories containing CMake projects
1014 file(GLOB entries *)
204208
205209 else() # if this is included from LLVM's CMake
206210 include(LLVMExternalProjectUtils)
211 if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR)
212 set(LIBCXX_HEADER_DIR ${LLVM_INCLUDE_DIR}/c++/v1/)
213 set(CXX_HEADER_TARGET runtime-libcxx-headers)
214 add_subdirectory(${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}/include ${CXX_HEADER_TARGET})
215 endif()
207216
208217 if(NOT LLVM_BUILD_RUNTIMES)
209218 set(EXTRA_ARGS EXCLUDE_FROM_ALL)
353362
354363 llvm_ExternalProject_Add(runtimes
355364 ${CMAKE_CURRENT_SOURCE_DIR}
356 DEPENDS ${ARG_DEPENDS}
365 DEPENDS ${ARG_DEPENDS} runtime-libcxx-headers
357366 # Builtins were built separately above
358367 CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
359368 -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
444453
445454 llvm_ExternalProject_Add(runtimes-${name}
446455 ${CMAKE_CURRENT_SOURCE_DIR}
447 DEPENDS ${${name}_deps}
456 DEPENDS ${${name}_deps} runtime-libcxx-headers
448457 # Builtins were built separately above
449458 CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
450459 -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}