From dc5d951b73c9118511e33b8b07f2e94c41a379e7 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 3 Jul 2023 22:45:23 +0200 Subject: common.cmake: bump default C++ standard --- .github/actions/build-example/action.yml | 5 ++++- .github/workflows/boost_toolsets.yml | 2 ++ common.cmake | 4 ++-- examples/boost/CMakeLists.txt | 2 +- examples/dynamic/CMakeLists.txt | 2 +- examples/simple/CMakeLists.txt | 2 +- examples/static/CMakeLists.txt | 2 +- 7 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/actions/build-example/action.yml b/.github/actions/build-example/action.yml index 63dd6b0..8d684c1 100644 --- a/.github/actions/build-example/action.yml +++ b/.github/actions/build-example/action.yml @@ -19,6 +19,9 @@ inputs: description: Configuration to build required: false default: Debug + cmake-args: + description: Additional CMake arguments + required: false outputs: install-dir: description: Installation directory @@ -65,5 +68,5 @@ runs: $args += '--',$src_dir,'TMP' $env:VERBOSE = 1 - & $python -m project.build $args + & $python -m project.build $args ${{ inputs.cmake-args }} shell: pwsh diff --git a/.github/workflows/boost_toolsets.yml b/.github/workflows/boost_toolsets.yml index 52c95bb..8c57a0a 100644 --- a/.github/workflows/boost_toolsets.yml +++ b/.github/workflows/boost_toolsets.yml @@ -166,6 +166,8 @@ jobs: toolset: '${{ matrix.toolset }}' platform: '${{ matrix.platform }}' configuration: '${{ matrix.configuration }}' + # Older Boosts don't like the newer standards (auto_ptr, etc.) + cmake-args: -D CC_CXX_STANDARD=14 - name: Verify runtime library linkage uses: ./.github/actions/check-runtime-library diff --git a/common.cmake b/common.cmake index d47c80a..619b062 100644 --- a/common.cmake +++ b/common.cmake @@ -10,7 +10,7 @@ # Add this to the top-level CMakeLists.txt (unless a higher version has already # been specified): # -# cmake_minimum_required(VERSION 3.1) +# cmake_minimum_required(VERSION 3.12) # Without this policy set, this line: # @@ -54,7 +54,7 @@ if(parent_dir) endif() if(NOT DEFINED CC_CXX_STANDARD) - set(CC_CXX_STANDARD "14" CACHE STRING "C++ standard version") + set(CC_CXX_STANDARD "20" CACHE STRING "C++ standard version") endif() if(NOT DEFINED CC_BEST_PRACTICES) option(CC_BEST_PRACTICES "Set common compiler options" "${default_value}") diff --git a/examples/boost/CMakeLists.txt b/examples/boost/CMakeLists.txt index c4d5edb..bfb1f68 100644 --- a/examples/boost/CMakeLists.txt +++ b/examples/boost/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) # for Boost::* imported targets +cmake_minimum_required(VERSION 3.12) project(example_boost) diff --git a/examples/dynamic/CMakeLists.txt b/examples/dynamic/CMakeLists.txt index 190b1c9..d4e0712 100644 --- a/examples/dynamic/CMakeLists.txt +++ b/examples/dynamic/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.12) project(example_dynamic) diff --git a/examples/simple/CMakeLists.txt b/examples/simple/CMakeLists.txt index 268b5db..94810a4 100644 --- a/examples/simple/CMakeLists.txt +++ b/examples/simple/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.12) project(example_simple) diff --git a/examples/static/CMakeLists.txt b/examples/static/CMakeLists.txt index e418aab..c5d77d3 100644 --- a/examples/static/CMakeLists.txt +++ b/examples/static/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.12) project(example_static) -- cgit v1.2.3