Skip to content

Commit aef7c59

Browse files
committed
[cmake] Set language and standard.
It is 2024 and all compilers should have implemented 17 by now
1 parent 6e5d9a0 commit aef7c59

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

CMakeLists.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
cmake_minimum_required(VERSION 3.4.3)
1010
project(xeus-cpp)
11+
12+
enable_language(CXX)
13+
set(CMAKE_CXX_EXTENSIONS NO)
14+
15+
set(CMAKE_CXX_STANDARD 17)
16+
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
17+
1118
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
1219

1320
set(XEUS_CPP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
@@ -107,14 +114,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"
107114
if(NOT EMSCRIPTEN)
108115
add_compile_options(-Wunused-parameter -Wextra -Wreorder)
109116
endif()
110-
111-
112-
CHECK_CXX_COMPILER_FLAG("-std=c++17" HAS_CPP_17_FLAG)
113-
if (HAS_CPP_17_FLAG)
114-
add_compile_options(-std=c++17)
115-
else ()
116-
message(FATAL_ERROR "Unsupported compiler -- xeus requires C++17 support!")
117-
endif ()
118117
endif ()
119118

120119
if(EMSCRIPTEN)

0 commit comments

Comments
 (0)