Skip to content

Specify C++ standard instead of leaving it up to the compiler#568

Merged
KoenBussemakerDeltares merged 2 commits intomainfrom
all/task/UNST-9623_cmake_specify_cpp_standard
Feb 9, 2026
Merged

Specify C++ standard instead of leaving it up to the compiler#568
KoenBussemakerDeltares merged 2 commits intomainfrom
all/task/UNST-9623_cmake_specify_cpp_standard

Conversation

@KoenBussemakerDeltares
Copy link
Copy Markdown
Contributor

What was done

Instead of using whatever default is set (which differs per compiler and per version), specify the C++ standard in CMake. I chose the C++17 for now but this can be changed if need be.

I also disabled compiler-specific extensions which should lead to fever cross-platform headaches in the future. This causes the linux compile definition to disappear since it's not POSIX compliant, hence why I had to change it to __linux__ in several places.

Evidence of the work done

  • Video/figures
    <add video/figures if applicable>
  • Clear from the issue description
  • Not applicable

Tests

  • Tests updated
    <add testcase numbers if applicable, Issue number>
  • Not applicable

Documentation

  • Documentation updated
    <add description of changes if applicable, Issue number>
  • Not applicable

Issue link

Copy link
Copy Markdown
Contributor

@harmenwierenga harmenwierenga left a comment

Choose a reason for hiding this comment

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

FBCTools (src/engines_gpl/fbc/packages/FBCTools/CMakeLists.txt, C++11) and now the new csumo_precice project (src/tools_gpl/csumo_precice/CMakeLists.txt, C++23) override these. It's good to have a decent default though, currently we have the compiler ones (gcc 14 has gnu17 and visual studio 2022 has c++14 I think), and this will apply to dimr.

Comment thread src/engines_gpl/dimr/packages/dimr_lib/src/dimr.cpp
@KoenBussemakerDeltares KoenBussemakerDeltares merged commit 3eff99b into main Feb 9, 2026
21 checks passed
@KoenBussemakerDeltares KoenBussemakerDeltares deleted the all/task/UNST-9623_cmake_specify_cpp_standard branch February 9, 2026 08:01
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.

2 participants