32
32
option (CMAKE_VERBOSE_MAKEFILE "Show the complete build commands" OFF )
33
33
34
34
# possibility to disable build steps
35
- option (CORE_BUILD_EXAMPLES "Build examples for modern.cpp.core " ON )
36
- option (CORE_BUILD_TESTS "Build tests for modern.cpp.core " ON )
35
+ option (CORE_BUILD_EXAMPLES "Build examples" ON )
36
+ option (CORE_BUILD_TESTS "Build tests" ON )
37
37
38
38
# General
39
39
set (CMAKE_TLS_VERIFY TRUE )
@@ -53,7 +53,8 @@ include(CheckCCompilerFlag)
53
53
if (CMAKE_C_COMPILER_ID STREQUAL "MSVC" OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC" )
54
54
check_c_compiler_flag(/std:c23 HAVE_FLAG_STD_C23)
55
55
check_c_compiler_flag(/std:c17 HAVE_FLAG_STD_C17)
56
- if (CMAKE_C_COMPILER_ID MATCHES Clang)
56
+ # Visual Studio 2019 will have clang-12, Visual Studio will have clang-15, but cmake do not know how to set the standard for that.
57
+ if (CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_VERSION VERSION_LESS 16.0)
57
58
set (HAVE_FLAG_STD_C23 OFF )
58
59
endif ()
59
60
else ()
@@ -75,8 +76,10 @@ set(CMAKE_C_EXTENSIONS OFF)
75
76
include (CheckCXXCompilerFlag)
76
77
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC" )
77
78
check_cxx_compiler_flag(/std:c++23 HAVE_FLAG_STD_CXX23)
79
+ # An issue with visual studio 2019 with fetch project and same settings, so check early
78
80
check_cxx_compiler_flag(/std:c++20 HAVE_FLAG_STD_CXX20)
79
- if (CMAKE_CXX_COMPILER_ID MATCHES Clang)
81
+ # Visual Studio 2019 will have clang-12, but cmake do not know how to set the standard for that.
82
+ if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
80
83
set (HAVE_FLAG_STD_CXX23 OFF )
81
84
endif ()
82
85
else ()
@@ -113,7 +116,7 @@ if(CORE_MASTER_PROJECT AND CMAKE_BUILD_TYPE STREQUAL Release)
113
116
endif ()
114
117
endif ()
115
118
116
- # Compiler configuration
119
+ # Warning flags
117
120
include (${CMAKE} /clang_warnings.cmake)
118
121
include (${CMAKE} /gcc_warnings.cmake)
119
122
include (${CMAKE} /msvc_warnings.cmake)
0 commit comments