CMake's better handling c++14 requirement#31916
Merged
veblush merged 3 commits intogrpc:masterfrom Jan 27, 2023
Merged
Conversation
2e0208d to
6d1060d
Compare
Contributor
Author
|
CC @coryan |
coryan
reviewed
Jan 23, 2023
coryan
reviewed
Jan 23, 2023
1f541ec to
2ebc5d9
Compare
Contributor
Author
|
@drfloob AJ, would you review this as Jan is OOO? |
Contributor
jtattermusch
left a comment
There was a problem hiding this comment.
Overall looks fine, but I had one concern - see comment.
|
|
||
| if compiler == 'default' or compiler == 'cmake': | ||
| return ('debian11', []) | ||
| return ('debian11', ["-DCMAKE_CXX_STANDARD=14"]) |
Contributor
There was a problem hiding this comment.
It feels odd that to our "default" build via run_tests.py we need to pass extra options.
Would that mean that if one builds with cmake by hand, without passing any extra configuration, they would get a differently configured build that if they run run_tests.py? If so, that feels wrong.
Contributor
Author
There was a problem hiding this comment.
This is required because of Apple clang which uses C++98 by default (yay). Also this is only for tests and gRPC library targets don't specify it so that C++ version can be picked by applications.
drfloob
approved these changes
Jan 27, 2023
XuanWang-Amos
pushed a commit
to XuanWang-Amos/grpc
that referenced
this pull request
May 1, 2023
* Bumped the cmake version version to 3.8 * Switch to target_compile_features for cxx_std_14 * Regen
wanlin31
pushed a commit
that referenced
this pull request
May 18, 2023
* Bumped the cmake version version to 3.8 * Switch to target_compile_features for cxx_std_14 * Regen
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.
As Cmake got a better way to specify that C++14 or above is required with target_compile_features, gRPC needs to use this instead of using
CMAKE_CXX_STANDARDwhich should be done by the application. This is also aligned with how Cloud C++ does.In order for gRPC to get this change, the minium version of cmake should be bumped to 3.8, which is acceptable as OSS C++ policy needs 3.10 as the oldest version of cmake to support.