[llvm] r284650 - [CMake] Make the runtimes directory work with bootstrap builds

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 14:50:25 PDT 2016


Author: cbieneman
Date: Wed Oct 19 16:50:25 2016
New Revision: 284650

URL: http://llvm.org/viewvc/llvm-project?rev=284650&view=rev
Log:
[CMake] Make the runtimes directory work with bootstrap builds

This patch builds on clang r284648, and allows the runtime directory to make the bootstrap builds depend on the builtin libraries.

This patch also make the bootstrap build depend on configuring the other runtimes because the libcxx headers are copied during configuration. I have left a TODO in the code to remove that once I come up with a better solution.

Modified:
    llvm/trunk/runtimes/CMakeLists.txt

Modified: llvm/trunk/runtimes/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/runtimes/CMakeLists.txt?rev=284650&r1=284649&r2=284650&view=diff
==============================================================================
--- llvm/trunk/runtimes/CMakeLists.txt (original)
+++ llvm/trunk/runtimes/CMakeLists.txt Wed Oct 19 16:50:25 2016
@@ -146,6 +146,11 @@ else() # if this is included from LLVM's
                              PASSTHROUGH_PREFIXES COMPILER_RT
                              USE_TOOLCHAIN)
     set(deps builtins)
+    # We don't need to depend on the builtins if we're building instrumented
+    # because the next stage will use the same compiler used to build this stage.
+    if(NOT LLVM_BUILD_INSTRUMENTED AND CLANG_ENABLE_BOOTSTRAP)
+      add_dependencies(clang-bootstrap-deps builtins)
+    endif()
   endif()
 
   # We create a list the names of all the runtime projects in all uppercase and
@@ -196,6 +201,16 @@ else() # if this is included from LLVM's
                                             ${SUB_COMPONENT_CHECK_TARGETS}
                                             ${SUB_INSTALL_TARGETS}
                              USE_TOOLCHAIN)
+    
+    # TODO: This is a hack needed because the libcxx headers are copied into the
+    # build directory during configuration. Without that step the clang in the
+    # build directory cannot find the C++ headers in certain configurations.
+    # I need to build a mechanism for runtime projects to provide CMake code
+    # that executes at LLVM configuration time to handle this case.
+    if(NOT LLVM_BUILD_INSTRUMENTED AND CLANG_ENABLE_BOOTSTRAP)
+      add_dependencies(clang-bootstrap-deps runtimes-configure)
+    endif()
+
     if(LLVM_INCLUDE_TESTS)
       set_property(GLOBAL APPEND PROPERTY LLVM_ADDITIONAL_TEST_DEPENDS runtimes-test-depends)
       set_property(GLOBAL APPEND PROPERTY LLVM_ADDITIONAL_TEST_TARGETS check-runtimes)




More information about the llvm-commits mailing list