[llvm] [CMake] Omit the generic runtimes targets for subbuilds (PR #76097)

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 11:54:44 PST 2023


https://github.com/petrhosek created https://github.com/llvm/llvm-project/pull/76097

We currently create a generic runtime target for all subbuilds. For example if we're building libcxx for aarch64-linux-gnu and x86_64-linux-gnu, we would create the cxx target that would depend on cxx-aarch64-linux-gnu and cxx-x86_64-linux-gnu. The current implementation is subtly broken in the case where different subbuilds enable different runtimes. Rather than addressing the issue which would introduce more complexity, we omit these targets altogether to simplify the build. If needed, they can be reintroduced later.

>From 528c0304df4ef066debda7fe1cb8dd2901476331 Mon Sep 17 00:00:00 2001
From: Petr Hosek <phosek at google.com>
Date: Wed, 20 Dec 2023 19:30:19 +0000
Subject: [PATCH] [CMake] Omit the generic runtimes targets for subbuilds

We currently create a generic runtime target for all subbuilds. For
example if we're building libcxx for aarch64-linux-gnu and
x86_64-linux-gnu, we would create the cxx target that would depend on
cxx-aarch64-linux-gnu and cxx-x86_64-linux-gnu. The current
implementation is subtly broken in the case where different subbuilds
enable different runtimes. Rather than addressing the issue which would
introduce more complexity, we omit these targets altogether to simplify
the build. If needed, they can be reintroduced later.
---
 llvm/runtimes/CMakeLists.txt | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 77254b7eb5e622..fc314286954ab0 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -390,11 +390,6 @@ function(runtime_register_target name)
     add_dependencies(check-runtimes check-runtimes-${name})
     add_dependencies(runtimes-test-depends runtimes-test-depends-${name})
   endif()
-  foreach(runtime_name ${runtime_names})
-    add_dependencies(${runtime_name} ${runtime_name}-${name})
-    add_dependencies(install-${runtime_name} install-${runtime_name}-${name})
-    add_dependencies(install-${runtime_name}-stripped install-${runtime_name}-${name}-stripped)
-  endforeach()
   foreach(component ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS})
     add_dependencies(${component} ${component}-${name})
     add_dependencies(install-${component} install-${component}-${name})
@@ -459,11 +454,6 @@ if(runtimes)
         add_custom_target(runtimes-test-depends)
         set(test_targets "")
       endif()
-      foreach(runtime_name ${RUNTIME_NAMES})
-        add_custom_target(${runtime_name})
-        add_custom_target(install-${runtime_name})
-        add_custom_target(install-${runtime_name}-stripped)
-      endforeach()
       if(LLVM_RUNTIME_DISTRIBUTION_COMPONENTS)
         foreach(component ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS})
           add_custom_target(${component})



More information about the llvm-commits mailing list