@@ -23,18 +23,17 @@ math(EXPR CORENEURON_VERSION_COMBINED
2323# =============================================================================
2424# CMake common project settings
2525# =============================================================================
26- set (CMAKE_CXX_STANDARD 14 )
26+ set (CMAKE_CXX_STANDARD 17 )
2727set (CMAKE_CXX_STANDARD_REQUIRED ON )
2828set (CMAKE_CXX_EXTENSIONS OFF )
2929set (CMAKE_BUILD_TYPE
3030 RelWithDebInfo
3131 CACHE STRING "Empty or one of Debug, Release, RelWithDebInfo" )
3232
33- if (NOT "cxx_std_14" IN_LIST CMAKE_CXX_COMPILE_FEATURES OR NOT "cxx_digit_separators" IN_LIST
34- CMAKE_CXX_COMPILE_FEATURES)
33+ if (NOT "cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
3534 message (
3635 FATAL_ERROR
37- "This compiler does not fully support C++14 , choose an higher version or an other compiler." )
36+ "This compiler does not fully support C++17 , choose a higher version or another compiler." )
3837endif ()
3938
4039# =============================================================================
@@ -297,6 +296,11 @@ if(CORENRN_HAVE_NVHPC_COMPILER)
297296 # problem. If GPU support is disabled, we define R123_USE_INTRIN_H=0 to avoid the problem.
298297 list (APPEND CORENRN_COMPILE_DEFS R123_USE_INTRIN_H=0)
299298 endif ()
299+ # CMake versions <3.19 used to add -A when using NVHPC/PGI, which makes the compiler excessively
300+ # pedantic. See https://gitlab.kitware.com/cmake/cmake/-/issues/20997.
301+ if (CMAKE_VERSION VERSION_LESS 3.19)
302+ list (REMOVE_ITEM CMAKE_CXX17_STANDARD_COMPILE_OPTION -A)
303+ endif ()
300304endif ()
301305
302306# ~~~
0 commit comments