Skip to content

Commit 33baeb9

Browse files
committed
Default CMAKE_CXX_STANDARD to 20
So far, the user was required to set the C++ version. It is required that the user is able to select the version, as some users might want to work with the C++17 coroutine-ts and others want to work with C++20. However, this led to frustration with many users, as just invoking cmake did not lead to a working build. This patch changes the default to C++20, informing the user about this choice.
1 parent 3d21017 commit 33baeb9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
cmake_minimum_required(VERSION 3.12)
22
project(cppcoro LANGUAGES CXX)
33

4+
if(NOT "${CMAKE_CXX_STANDARD}")
5+
message("C++ version not set. Defaulting to CMAKE_CXX_STANDARD=20")
6+
set(CMAKE_CXX_STANDARD 20)
7+
endif()
8+
49
set(CMAKE_CXX_EXTENSIONS OFF)
510
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
611

0 commit comments

Comments
 (0)