Require c++17 at mimumum

This commit is contained in:
gabime 2023-09-15 16:26:50 +03:00
parent b3ab35cf8e
commit 501e3480ca
3 changed files with 14 additions and 5 deletions

View File

@ -12,10 +12,13 @@ jobs:
fail-fast: false
matrix:
config:
- { compiler: gcc, version: 11, build_type: Debug, cppstd: 17 }
- { compiler: gcc, version: 11, build_type: Debug, cppstd: 20 }
- { compiler: gcc, version: 13, build_type: Release, cppstd: 17 }
- { compiler: gcc, version: 13, build_type: Release, cppstd: 20 }
- { compiler: gcc, version: 13, build_type: Release, cppstd: 20, std_format: OFF }
- { compiler: gcc, version: 13, build_type: Release, cppstd: 20, std_format: ON }
- { compiler: clang, version: 15, build_type: Release, cppstd: 17}
- { compiler: clang, version: 15, build_type: Debug, cppstd: 20, asan: ON }
- { compiler: clang, version: 15, build_type: Release, cppstd: 20, asan: OFF }
container:

View File

@ -25,7 +25,13 @@ endif()
# ---------------------------------------------------------------------------------------
# Compiler config
# ---------------------------------------------------------------------------------------
set(CMAKE_CXX_STANDARD 20)
# c++ standard >=17 is required
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
elseif(CMAKE_CXX_STANDARD LESS 17)
message(FATAL_ERROR "Minimum supported CMAKE_CXX_STANDARD is 17, but CMAKE_CXX_STANDARD is set to a lower value.")
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# make sure __cplusplus is defined when using msvc and enable parallel build

View File

@ -9,7 +9,7 @@ environment:
WCHAR_FILES: 'OFF'
BUILD_EXAMPLE: 'ON'
USE_STD_FORMAT: 'OFF'
CXX_STANDARD: 11
CXX_STANDARD: 17
- GENERATOR: '"Visual Studio 15 2017 Win64"'
BUILD_TYPE: Release
BUILD_SHARED: 'OFF'
@ -17,7 +17,7 @@ environment:
WCHAR_FILES: 'OFF'
BUILD_EXAMPLE: 'ON'
USE_STD_FORMAT: 'OFF'
CXX_STANDARD: 11
CXX_STANDARD: 17
- GENERATOR: '"Visual Studio 15 2017 Win64"'
BUILD_TYPE: Release
BUILD_SHARED: 'ON'
@ -25,7 +25,7 @@ environment:
WCHAR_FILES: 'OFF'
BUILD_EXAMPLE: 'ON'
USE_STD_FORMAT: 'OFF'
CXX_STANDARD: 11
CXX_STANDARD: 17
- GENERATOR: '"Visual Studio 15 2017 Win64"'
BUILD_TYPE: Release
BUILD_SHARED: 'ON'
@ -33,7 +33,7 @@ environment:
WCHAR_FILES: 'ON'
BUILD_EXAMPLE: 'OFF'
USE_STD_FORMAT: 'OFF'
CXX_STANDARD: 11
CXX_STANDARD: 17
- GENERATOR: '"Visual Studio 16 2019" -A x64'
BUILD_TYPE: Release
BUILD_SHARED: 'ON'