[llvm] [CMake] Simplify building of bolt-optimized clang for distribution builds (PR #117772)
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 26 11:37:12 PST 2024
https://github.com/tstellar created https://github.com/llvm/llvm-project/pull/117772
Currently if you want to do a distribution build (i.e. using LLVM_DISTIRIBUTION_COMPONENTS) with a bolt-optimized clang, then you need to pass two separate targets to ninja like this:
ninja -C build clang-bolt distribiution
This patch simplifies this workflow so that you can do a distribution build with a bolt-optimized build with just a single target:
ninja -C build distribution
>From 99e42cff2ae12cd45d39f1de95c14b89a4f7aa6e Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 26 Nov 2024 14:24:27 +0000
Subject: [PATCH] [CMake] Simplify building of bolt-optimized clang for
distribution builds
Currently if you want to do a distribution build (i.e. using
LLVM_DISTIRIBUTION_COMPONENTS) with a bolt-optimized clang, then
you need to pass two separate targets to ninja like this:
ninja -C build clang-bolt distribiution
This patch simplifies this workflow so that you can do a
distribution build with a bolt-optimized build with just a single target:
ninja -C build distribution
---
llvm/cmake/modules/LLVMDistributionSupport.cmake | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/llvm/cmake/modules/LLVMDistributionSupport.cmake b/llvm/cmake/modules/LLVMDistributionSupport.cmake
index 03c67735702318..a4e341713393f7 100644
--- a/llvm/cmake/modules/LLVMDistributionSupport.cmake
+++ b/llvm/cmake/modules/LLVMDistributionSupport.cmake
@@ -276,6 +276,11 @@ function(llvm_distribution_add_targets)
# This happens for example if a target is an INTERFACE target.
if(TARGET ${target})
add_dependencies(${distribution_target} ${target})
+ # Add a special case for bolt-optimized clang. This will ensure that the
+ # bolt optimized clang is built with the rest of the distribution.
+ if (target STREQUAL "clang" AND TARGET clang-bolt)
+ add_dependencies(${distribution_target} clang-bolt)
+ endif()
endif()
if(TARGET install-${target})
More information about the llvm-commits
mailing list