[clang] 3ef20e3 - [CMake][Release] Add option for enabling LTO to cache file (#77035)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 11 17:05:32 PST 2024
Author: Tom Stellard
Date: 2024-01-11T17:05:28-08:00
New Revision: 3ef20e3fc1910977630b0392558731b199cf38e5
URL: https://github.com/llvm/llvm-project/commit/3ef20e3fc1910977630b0392558731b199cf38e5
DIFF: https://github.com/llvm/llvm-project/commit/3ef20e3fc1910977630b0392558731b199cf38e5.diff
LOG: [CMake][Release] Add option for enabling LTO to cache file (#77035)
This option is LLVM_RELEASE_ENABLE_LTO and it's turned on by default.
Added:
Modified:
clang/cmake/caches/Release.cmake
Removed:
################################################################################
diff --git a/clang/cmake/caches/Release.cmake b/clang/cmake/caches/Release.cmake
index 3ea65ce26296c8..a7b9a8d0e29f88 100644
--- a/clang/cmake/caches/Release.cmake
+++ b/clang/cmake/caches/Release.cmake
@@ -2,6 +2,9 @@
# BOOTSTRAP_* options configure the second build.
# BOOTSTRAP_BOOTSTRAP_* options configure the third build.
+# General Options
+set(LLVM_RELEASE_ENABLE_LTO THIN CACHE STRING "")
+
set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")
# Stage 1 Bootstrap Setup
@@ -33,9 +36,17 @@ set(BOOTSTRAP_CLANG_BOOTSTRAP_TARGETS
check-clang CACHE STRING "")
# Stage 2 Options
-set(BOOTSTRAP_LLVM_ENABLE_PROJECTS "clang" CACHE STRING "")
+set(STAGE2_PROJECTS "clang")
+if (LLVM_RELEASE_ENABLE_LTO)
+ list(APPEND STAGE2_PROJECTS "lld")
+endif()
+set(BOOTSTRAP_LLVM_ENABLE_PROJECTS ${STAGE2_PROJECTS} CACHE STRING "")
set(BOOTSTRAP_LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
# Stage 3 Options
set(BOOTSTRAP_BOOTSTRAP_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
set(BOOTSTRAP_BOOTSTRAP_LLVM_ENABLE_PROJECTS "clang;lld;lldb;clang-tools-extra;bolt;polly;mlir;flang" CACHE STRING "")
+set(BOOTSTRAP_BOOTSTRAP_LLVM_ENABLE_LTO ${LLVM_RELEASE_ENABLE_LTO} CACHE STRING "")
+if (LLVM_RELEASE_ENABLE_LTO)
+ set(BOOTSTRAP_BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
+endif()
More information about the cfe-commits
mailing list