diff --git a/llvm/cmake/modules/LLVMDistributionSupport.cmake b/llvm/cmake/modules/LLVMDistributionSupport.cmake index 03c6773570231..fe19db8515e26 100644 --- a/llvm/cmake/modules/LLVMDistributionSupport.cmake +++ b/llvm/cmake/modules/LLVMDistributionSupport.cmake @@ -276,6 +276,13 @@ 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) + add_dependencies(install-${distribution_target} clang-bolt) + add_dependencies(install-${distribution_target}-stripped clang-bolt) + endif() endif() if(TARGET install-${target})