diff --git a/CMakeLists.txt b/CMakeLists.txt index 17bd614f..62453a02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,14 @@ cmake_minimum_required(VERSION 3.13) +if (NOT CMAKE_CXX_STANDARD) + set (CMAKE_CXX_STANDARD 20) +endif() + +# EKAT requires C++20 +if(CMAKE_CXX_STANDARD LESS 20) + message(FATAL_ERROR "EKAT requires C++20 or greater. Current value: ${CMAKE_CXX_STANDARD}") +endif() + set (EKAT_CMAKE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake CACHE INTERNAL "") # Do not ignore env vars in find_package() calls diff --git a/cacts.yaml b/cacts.yaml index c676a4b6..99c5caed 100644 --- a/cacts.yaml +++ b/cacts.yaml @@ -92,7 +92,6 @@ configurations: uses_baselines: False on_by_default: True cmake_args: - CMAKE_CXX_STANDARD: 20 EKAT_ENABLE_ALL_PACKAGES: True EKAT_TEST_THREAD_INC: ${2 if machine.gpu_arch is None else 1} EKAT_TEST_MAX_THREADS: ${machine.num_run_res if machine.gpu_arch is None else 1} diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 6e969021..edd83db3 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -59,9 +59,6 @@ add_library(ekat_core ekat_test_utils.cpp ) -# EKAT requires c++17 features -target_compile_features(ekat_core PUBLIC cxx_std_17) - # Add the correct ekat::Comm impl file, depending on whether MPI is ON/OFF. if (EKAT_ENABLE_MPI) target_sources(ekat_core PRIVATE ekat_comm.cpp)