Skip to content
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

build: Make C++17 be the default (C++14 is still the minimum for now) #4022

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Oct 14, 2023

This is for master only! Will not be backported to any release branch.

We are assuming the 2.5 release family will be the last to support C++14, and the next year's 2.6 family will raise the minimum to C++17. We're not ready to throw that switch yet, but as an intermediate step, let's raise the default level to C++17. It's still possible to compile for C++14, but to do so, one must proactively -DCMAKE_CXX_STANDARD=14.

This has two benefits:

  1. The majority of people who are already using a C++17-capable compiler will take advantage of those features by default, instead of needlessly restricting to C++14.

  2. The people using a compiler that tops out at C++14 (e.g., gcc 6.3) are going to have to set -DCMAKE_CXX_STANDARD=14, thus making them aware that (in master anyway) they're swimming against the current and have a limited time in which that will continue to work.

I hope that some time around the new year, we'll be able to fully raise the minimum to 17? But it's going to depend on my place and other major users finally retiring the DCC versions that require a gcc6/C++14 ecosystem, and we're not quite ready to do that at this moment. Soon, soon.

This is for master only! Will not be backported to any release branch.

We are assuming the 2.5 release family will be the last to support
C++14, and the next year's 2.6 family will raise the minimum to C++17.
We're not ready to throw that switch yet, but as an intermediate step,
let's raise the *default* level to C++17. It's still possible to
compile for C++14, but to do so, one must proactively
`-DCMAKE_CXX_STANDARD=14`.

This has two benefits:

1. The majority of people who are already using a C++17-capable
   compiler will take advantage of those features by default, instead
   of needlessly restricting to C++14.

2. The people using a compiler that tops out at C++14 (e.g., gcc 6.3)
   are going to have to set `-DCMAKE_CXX_STANDARD=14`, thus making
   them aware that (in master anyway) they're swimming against the
   current and have a limited time in which that will continue to
   work.

I hope that some time around the new year, we'll be able to fully
raise the minimum to 17? But it's going to depend on my place and
other major users finally retiring the DCC versions that require a
gcc6/C++14 ecosystem, and we're not quite ready to do that at this
moment. Soon, soon.

Signed-off-by: Larry Gritz <[email protected]>
Copy link
Collaborator

@ThiagoIze ThiagoIze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me.

@jessey-git
Copy link
Contributor

I think this is ok as well. There's 2 additional locations though. Should those change as well?

testsuite\cmake-consumer\CMakeLists.txt:16:set (CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to prefer (14, 17, etc.)")

testsuite\docs-examples-cpp\CMakeLists.txt:16:set (CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to prefer (14, 17, etc.)")

@lgritz
Copy link
Collaborator Author

lgritz commented Oct 16, 2023

@jessey-git I don't think so? These are testsuite entries that are intentionally independent of the OIIO build system itself. So there's a real sense that it's helping to test that from a user program perspective, software can still be built against OIIO at the lowest supported C++ level (even if OIIO itself was built at a higher level, if you know what I mean).

@lgritz lgritz merged commit 824e6df into AcademySoftwareFoundation:master Oct 16, 2023
24 of 25 checks passed
@lgritz lgritz deleted the lg-cpp branch October 17, 2023 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants