-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
treewide: define default C&C++ versions for compilers #255979
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -80,6 +80,8 @@ let | |||||||||
| "-Dprotobuf_ABSL_PROVIDER=package" | ||||||||||
| ] ++ lib.optionals (!stdenv.targetPlatform.isStatic) [ | ||||||||||
| "-Dprotobuf_BUILD_SHARED_LIBS=ON" | ||||||||||
| ] ++ lib.optionals (stdenv.cc.cc.defaultCxxStandard < 14) [ | ||||||||||
| "-DCMAKE_CXX_STANDARD=14" | ||||||||||
|
Comment on lines
+83
to
+84
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
What?? How can
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea here is to pass
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I understood. The default C++ standard is not the same as the supported C++ standard. However it looks too superfluous.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the default is newer than 14 some of the dependencies are not API compatible (cough, abseil, cough), so that approach doesn't work.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should write a comment to explain that so that the next guy who looks as this doesn't go through the same process. |
||||||||||
| ] | ||||||||||
| # Tests fail to build on 32-bit platforms; fixed in 3.22 | ||||||||||
| # https://github.com/protocolbuffers/protobuf/issues/10418 | ||||||||||
|
|
||||||||||
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.
Can this be treated as int?
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.
I'm not sure what you mean?
In case you are thinking of
gnu11vsc++11: That almost never makes a difference. Allowing arithmetic on this value is what makes it useful.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.
Understandable.
The problem to me is because e.g C20 comes after C99 however 20<99.
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.
That is a very astute observation. It seems I'll need to change to interface to a
defaultCxxStandardless = YY: ...function. Bummer.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.
This is another reason why it's better to detect "is the compiler going to use a standard equal to or later than XYZ" like autoconf does -- no need to encode the entire list of standards in nix, along with their partial order.