3232option (CMAKE_VERBOSE_MAKEFILE "Show the complete build commands" OFF )
3333
3434# 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 )
3737
3838# General
3939set (CMAKE_TLS_VERIFY TRUE )
@@ -53,7 +53,8 @@ include(CheckCCompilerFlag)
5353if (CMAKE_C_COMPILER_ID STREQUAL "MSVC" OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC" )
5454 check_c_compiler_flag(/std:c23 HAVE_FLAG_STD_C23)
5555 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)
5758 set (HAVE_FLAG_STD_C23 OFF )
5859 endif ()
5960else ()
@@ -75,8 +76,10 @@ set(CMAKE_C_EXTENSIONS OFF)
7576include (CheckCXXCompilerFlag)
7677if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC" )
7778 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
7880 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)
8083 set (HAVE_FLAG_STD_CXX23 OFF )
8184 endif ()
8285else ()
@@ -113,7 +116,7 @@ if(CORE_MASTER_PROJECT AND CMAKE_BUILD_TYPE STREQUAL Release)
113116 endif ()
114117endif ()
115118
116- # Compiler configuration
119+ # Warning flags
117120include (${CMAKE} /clang_warnings.cmake)
118121include (${CMAKE} /gcc_warnings.cmake)
119122include (${CMAKE} /msvc_warnings.cmake)
0 commit comments