-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Automatically update the CXX_STANDARD #64248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically update the CXX_STANDARD #64248
Conversation
message(FATAL_ERROR "Requested CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} which is less than the minimum C++ standard ${SWIFT_MIN_CXX_STANDARD}") | ||
endif() | ||
|
||
set(CMAKE_CXX_STANDARD ${SWIFT_MIN_CXX_STANDARD} CACHE STRING "C++ standard to conform to") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this not need to be forced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unset(CMAKE_CXX_STANDARD)
will override it. I didn't wan't to force it in case someone did -DCMAKE_CXX_STANDARD=42
or had it set in some other way.
I think this is almost identical to how LLVM is handling the update now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Correction:
unset
will remove it from the cache and let theCACHE
var write it back with the new value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
fe1ecb1
to
32f0498
Compare
Folks are running into issues updating because the CXX standard is cached and we updated it. This patch allows CMake to update it to a minimum required version for Swift. If it's in the cache and too low, it will update it. If it's manually specified and too low, it will give a fatal error letting the dev know it's too low.
32f0498
to
e695385
Compare
@swift-ci please smoke test |
Windows failure looks like |
@swift-ci please smoke test windows |
Folks are running into issues updating because the CXX standard is cached and we updated it. This patch allows CMake to update it to a minimum required version for Swift. If it's in the cache and too low, it will update it. If it's manually specified and too low, it will give a fatal error letting the dev know it's too low.