Repository navigation
[CMake] Require CMake 3.29 to enable CMP0157 - #2252
Open
charles-zablit wants to merge 1 commit into
Open
charles-zablit wants to merge 1 commit into
charles-zablit wants to merge 1 commit into
Conversation
charles-zablit
requested review from
DougGregor,
artemcm,
compnerd and
owenv
as code owners
November 5, 2026 00:12
7 of 26 tasks
compnerd
reviewed
Nov 5, 2026
| @@ -8,6 +8,10 @@ | |||
|
|
|||
| cmake_minimum_required(VERSION 3.19.6) | |||
Member
There was a problem hiding this comment.
Can we consider bumping this to 3.29 instead?
Comment on lines
+26
to
+28
| if(POLICY CMP0157 AND PROJECT_IS_TOP_LEVEL) | ||
| set(CMAKE_Swift_COMPILATION_MODE "$<IF:$<CONFIG:Release,RelWithDebInfo,MinSizeRel>,wholemodule,incremental>") | ||
| endif() |
Member
There was a problem hiding this comment.
Can we sink this into the caller? That allows the caller to make the choice for wholemodule vs incremental.
etcwilde
reviewed
Nov 5, 2026
|
|
||
| cmake_minimum_required(VERSION 3.19.6) | ||
|
|
||
| if(POLICY CMP0157) |
Member
There was a problem hiding this comment.
Is there a reason to not bump the min required to CMake 3.29 or 3.30? There are other parts of the build that already require a newer CMake version. Then we can drop the checks.
| LANGUAGES C CXX Swift) | ||
|
|
||
| if(POLICY CMP0157 AND PROJECT_IS_TOP_LEVEL) | ||
| set(CMAKE_Swift_COMPILATION_MODE "$<IF:$<CONFIG:Release,RelWithDebInfo,MinSizeRel>,wholemodule,incremental>") |
Member
There was a problem hiding this comment.
We should only be setting this if it hasn't already been set so that we aren't overriding the vendor of the driver.
compnerd
requested changes
Nov 5, 2026
charles-zablit
force-pushed
the
cz/cmake/cmp0157
branch
from
November 6, 2026 14:17
9b8a2fb to
a8426c4
Compare
compnerd
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Require CMake 3.29, which makes CMP0157 NEW: Ninja compiles each Swift module in its own step, separate from the link. The policy no longer adds
-wmoto optimized builds, sobuild-script-helper.pynow passesCMAKE_Swift_COMPILATION_MODE=wholemodule, as build.ps1 and build-script do (swiftlang/swift#94066).Tracking: swiftlang/swift#93995
assisted by Claude