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

cmake: Handle C++ standard selection and propagation via CMake features #300

Merged
merged 4 commits into from
May 12, 2020

Conversation

bradking
Copy link
Contributor

C++11 is now required by TriBITS clients. Enable support unconditionally. Use CMake's standard settings for specifying the C++ standard and propagating it to dependents. Avoid hard-coding -std= flags, as doing so breaks CMake's model of the compiler's C++ standard modes.

Drop the ${PROJECT_NAME}_ENABLE_CXX11 option and hard-code a variable of the same name to "ON" to preserve compatibility while clients are updated.

@bradking
Copy link
Contributor Author

See trilinos/Trilinos#6814 for the Trilinos updates using this change to TriBITS.

Copy link
Member

@bartlettroscoe bartlettroscoe left a comment

Choose a reason for hiding this comment

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

@bradking, just to be clear, this really will just result in -std=c++11 being removed from CMAKE_CXX_FLAGS including from Makefile.export.* files? Therefore, I think this break backward compatibility for Makefile customers that use those files so we will need to note that in the ReleaseNotes.txt file. But this does not yet completely break Makefile.export.* files as Makefile clients could just add back whatever -std=c++<xx> flag they want. So this does not yet complete break that feature.

Therefore, I don't see any reason not to merge this PR along with trilinos/Trilinos#6814 and kokkos/kokkos#2749.

@bartlettroscoe bartlettroscoe added this to ToDo in TriBITS via automation Feb 11, 2020
@bartlettroscoe bartlettroscoe moved this from ToDo to In Progress in TriBITS Feb 11, 2020
Copy link
Member

@bartlettroscoe bartlettroscoe left a comment

Choose a reason for hiding this comment

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

Adding comments from trilinos/Trilinos#6814 that I should have put in this PR.

I will need to carefully test this myself locally with Trilinos and against SPARC and EMPIRE before I merge this but this looks great.

@bradking bradking changed the title WIP: cmake: Handle C++ standard selection and propagation via CMake features cmake: Handle C++ standard selection and propagation via CMake features Feb 12, 2020
@bradking
Copy link
Contributor Author

I will need to carefully test ... before I merge this but this looks great.

Good. I've removed the WIP: prefix from the PR title because this can be merged without immediately affecting Trilinos.

TriBITS will be transitioned to always enable C++11 support using
CMake's standard settings.  Drop the option to turn it off.

Hard-code a variable of the same name to "ON" to preserve compatibility
while clients are updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
TriBITS
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants