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

Make the C++ standard configurable #2319

Merged
merged 7 commits into from
Mar 1, 2022
Merged

Conversation

hakonsbm
Copy link
Contributor

@hakonsbm hakonsbm commented Mar 1, 2022

The C++ standard can now be specified in CMake configuration with -Dwith-std=<C++ standard>. Default is C++11. Fixes #2259.

@hakonsbm hakonsbm added T: Enhancement New functionality, model or documentation S: Normal Handle this with default priority I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) labels Mar 1, 2022
@hakonsbm hakonsbm added this to To do in Installation via automation Mar 1, 2022
@heplesser heplesser requested a review from jougs March 1, 2022 13:44
Copy link
Contributor

@jougs jougs left a comment

Choose a reason for hiding this comment

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

This looks good to me in principle, but could the flag's name be changed to with-cpp-std? I think that would be more expressive.

Copy link
Contributor

@heplesser heplesser left a comment

Choose a reason for hiding this comment

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

Looks fine, just one little suggestion for documentation.

And please also add documentation for the option in the "Generic build configuration" section of https://github.com/nest/nest-simulator/blob/master/doc/userdoc/installation/cmake_options.rst

CMakeLists.txt Outdated Show resolved Hide resolved
Installation automation moved this from To do to Review Mar 1, 2022
hakonsbm and others added 3 commits March 1, 2022 15:10
Co-authored-by: Hans Ekkehard Plesser <hans.ekkehard.plesser@nmbu.no>
@hakonsbm hakonsbm requested review from heplesser and jougs March 1, 2022 14:20
@@ -120,6 +120,8 @@ Generic build configuration
| ``-Dwith-intel-compiler-flags=[OFF|<list;of;flags>]``| User defined flags for the Intel compiler |
| | [default='-fp-model strict']. Separate multiple flags by ';'. |
+------------------------------------------------------+------------------------------------------------------------------+
| ``-Dwith-cpp-std=[OFF|<C++ standard>]`` | C++ standard to use for compilation [default='c++11']. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Does -Dwith-cpp-std=OFF actually work and result in the default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does, OFF would just mean the default value. But because it's a bit confusing I have corrected the CMake variable now.

@heplesser heplesser merged commit adae043 into nest:master Mar 1, 2022
Installation automation moved this from Review to Done Mar 1, 2022
@hakonsbm hakonsbm deleted the cmake_std branch March 2, 2022 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority T: Enhancement New functionality, model or documentation
Projects
Installation
  
Done
Development

Successfully merging this pull request may close these issues.

Add CMake flag for C++ standard
3 participants