CMake: define target_compile_features with C/C++ standards - #4847
Merged
Conversation
mwtoews
marked this pull request as ready for review
September 8, 2026 08:27
Member
|
@mwtoews do you want this included in 9.9.0? |
Member
Author
|
@kbevers yes, and nothing else queued up. |
Member
Perfect. It looks good to me so merging and including in release notes |
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.
This defines the high level meta features for C/C++ support based on their standard, and set using
target_compile_featuresto the mainprojtarget. It is PUBLIC, meaning that the C/C++ standard applies to compile this library, and anything that links to it. The exported target would look like this:Also tidy-up some of the messages while setting the CMake standard variables. These never fail, so
message(CHECK_FAIL ...)is not needed (the failure, e.g. non-existing standard, happens before inproject()).Background information here.
Xref #1924