Skip to content

Commit b206bf0

Browse files
authored
Fix CLANG_BOOTSTRAP_TARGETS in Release.cmake (#106407)
# Problem Before this patch you could not build the `stage2-LLVM` for example because you first had to manually add it to `CLANG_BOOTSTRAP_TARGETS` in the `Release.cmake` and also add it to `LLVM_RELEASE_FINAL_STAGE_TARGETS` in the cmake configure run. Now you can just use `-DLLVM_RELEASE_FINAL_STAGE_TARGETS="LLVM;clang"` on the cmake CLI and be able to build the targets `stage2-LLVM` and `stage2-clang` without further changes to the cache file. # Solution Take all `LLVM_RELEASE_FINAL_STAGE_TARGETS` elements and append them prefixed with `stage2-` to `CLANG_BOOTSTRAP_TARGETS`. Afterwards all duplicates are removed.
1 parent 3e47883 commit b206bf0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

clang/cmake/caches/Release.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,22 @@ set(STAGE1_RUNTIMES "compiler-rt")
5555

5656
if (LLVM_RELEASE_ENABLE_PGO)
5757
list(APPEND STAGE1_PROJECTS "lld")
58-
set(CLANG_BOOTSTRAP_TARGETS
58+
set(tmp_targets
5959
generate-profdata
6060
stage2-package
6161
stage2-clang
62+
stage2
6263
stage2-install
6364
stage2-check-all
6465
stage2-check-llvm
65-
stage2-check-clang CACHE STRING "")
66+
stage2-check-clang)
67+
68+
foreach(X IN LISTS LLVM_RELEASE_FINAL_STAGE_TARGETS)
69+
list(APPEND tmp_targets "stage2-${X}")
70+
endforeach()
71+
list(REMOVE_DUPLICATES tmp_targets)
72+
73+
set(CLANG_BOOTSTRAP_TARGETS "${tmp_targets}" CACHE STRING "")
6674

6775
# Configuration for stage2-instrumented
6876
set(BOOTSTRAP_CLANG_ENABLE_BOOTSTRAP ON CACHE STRING "")

0 commit comments

Comments
 (0)