Skip to content

Commit

Permalink
[CMake][Release] Add option for enabling LTO to cache file (#77035)
Browse files Browse the repository at this point in the history
This option is LLVM_RELEASE_ENABLE_LTO and it's turned on by default.
  • Loading branch information
tstellar committed Jan 12, 2024
1 parent 8e9c531 commit 3ef20e3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion clang/cmake/caches/Release.cmake
Expand Up @@ -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
Expand Down Expand Up @@ -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()

0 comments on commit 3ef20e3

Please sign in to comment.