diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index db9c86d8..f92509b6 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: unittest: - name: "${{matrix.generator}} ${{matrix.toolset}} Boost ${{matrix.boost_version}} ${{matrix.build_type}} ${{matrix.name_args}}" + name: "${{matrix.generator}} ${{matrix.toolset}} Boost ${{matrix.boost_version}} ${{matrix.build_type}} C++${{matrix.standard}} ${{matrix.name_args}}" runs-on: ${{matrix.os}} defaults: run: @@ -16,6 +16,7 @@ jobs: os: [windows-2019, windows-2022] toolset: [v141, v142, v143, ClangCL] build_type: [Debug, Release] + standard: [14, 17, 20] generator: ["Visual Studio 16 2019", "Visual Studio 17 2022"] config_args: [""] build_args: [""] @@ -123,6 +124,7 @@ jobs: run: | cmake -T "${{matrix.toolset}}" \ -G "${{matrix.generator}}" \ + -DCMAKE_CXX_STANDARD=${{matrix.standard}} \ ${{matrix.config_args}} \ ${BOOST_COMPILER_ARG} \ "${GITHUB_WORKSPACE}" diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b66f596..b4208945 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,12 @@ elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) message(STATUS "Building for 32 bit platform") endif() +if(NOT "${CMAKE_CXX_STANDARD}") + set(CMAKE_CXX_STANDARD 14) +endif() + +message(STATUS "C++ standard set to ${CMAKE_CXX_STANDARD}") + option(ENABLE_TESTING "Enable Test Builds" ${WIN32}) option(ENABLE_EXAMPLES "Enable Examples Builds" ${WIN32}) option(ENABLE_DOCUMENTATION "Enable Documentation Builds" ${UNIX}) @@ -33,8 +39,6 @@ target_include_directories(${PROJECT_NAME} $ ) -target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_14) - if(WIN32) set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON)