[PATCH] D139913: [runtimes] Only depend on builtins for same target

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 21:56:34 PST 2022


smeenai created this revision.
smeenai added a reviewer: phosek.
Herald added a project: All.
smeenai requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We don't need to have built all the builtins before building the
runtimes for a particular target, only the builtins for that target.
While I'm here, rename the variable that stores the builtins dep to
something less generic than `deps`, to minimize the chances of
accidentally using a variable with the same name from an outer scope.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139913

Files:
  llvm/runtimes/CMakeLists.txt


Index: llvm/runtimes/CMakeLists.txt
===================================================================
--- llvm/runtimes/CMakeLists.txt
+++ llvm/runtimes/CMakeLists.txt
@@ -148,7 +148,7 @@
       add_dependencies(install-builtins-stripped install-builtins-${target}-stripped)
     endforeach()
   endif()
-  set(deps builtins)
+  set(builtins_dep 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)
@@ -385,13 +385,13 @@
   endif()
   if(NOT LLVM_RUNTIME_TARGETS)
     runtime_default_target(
-      DEPENDS ${deps} ${extra_deps}
+      DEPENDS ${builtins_dep} ${extra_deps}
       PREFIXES ${prefixes})
     set(test_targets check-runtimes)
   else()
     if("default" IN_LIST LLVM_RUNTIME_TARGETS)
       runtime_default_target(
-        DEPENDS ${deps} ${extra_deps}
+        DEPENDS ${builtins_dep} ${extra_deps}
         PREFIXES ${prefixes})
       list(REMOVE_ITEM LLVM_RUNTIME_TARGETS "default")
     else()
@@ -419,8 +419,11 @@
     endif()
 
     foreach(name ${LLVM_RUNTIME_TARGETS})
+      if(builtins_dep)
+        set(name_builtins_dep "${builtins_dep}-${name}")
+      endif()
       runtime_register_target(${name} ${name}
-        DEPENDS ${deps})
+        DEPENDS ${name_builtins_dep})
 
       add_dependencies(runtimes runtimes-${name})
       add_dependencies(runtimes-configure runtimes-${name}-configure)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139913.482358.patch
Type: text/x-patch
Size: 1506 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221213/bd0dfad9/attachment.bin>


More information about the llvm-commits mailing list