From 7189068037fe9842d25022a853324da84d89d342 Mon Sep 17 00:00:00 2001 From: Denis Blank Date: Mon, 12 Mar 2018 09:29:33 +0100 Subject: [PATCH] Also test MSVC with /std:c++latest --- CMakeLists.txt | 4 ++++ appveyor.yml | 5 +++++ cmake/compiler/msvc.cmake | 10 ++++++++++ test/playground/CMakeLists.txt | 9 ++++----- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8b9751..e6e75ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,10 @@ option(CTI_CONTINUABLE_WITH_EXPERIMENTAL_COROUTINE "Enable co_await support" OFF) +option(CTI_CONTINUABLE_WITH_CPP_LATEST + "Enable the highest C++ standard available for testing polyfills" + OFF) + include(cmake/CMakeLists.txt) set(THREADS_PREFER_PTHREAD_FLAG ON) diff --git a/appveyor.yml b/appveyor.yml index 82db213..8d60781 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,7 +4,11 @@ image: environment: matrix: - WITH_NO_EXCEPTIONS: OFF + WITH_CPP_LATEST: OFF - WITH_NO_EXCEPTIONS: ON + WITH_CPP_LATEST: OFF + - WITH_NO_EXCEPTIONS: OFF + WITH_CPP_LATEST: ON configuration: - Debug @@ -23,6 +27,7 @@ before_build: cmake -H. -Bbuild -A%PLATFORM% -DCTI_CONTINUABLE_WITH_NO_EXCEPTIONS=%WITH_NO_EXCEPTIONS% -DCTI_CONTINUABLE_WITH_EXPERIMENTAL_COROUTINE=ON + -DCTI_CONTINUABLE_WITH_CPP_LATEST=ON build_script: - cmd: cmake --build build --config %CONFIGURATION% --target ALL_BUILD -- /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /verbosity:minimal /maxcpucount:2 /nologo diff --git a/cmake/compiler/msvc.cmake b/cmake/compiler/msvc.cmake index dc0522e..e8ccecf 100644 --- a/cmake/compiler/msvc.cmake +++ b/cmake/compiler/msvc.cmake @@ -41,6 +41,16 @@ target_compile_options(continuable-features-warnings INTERFACE /W4) +if (CTI_CONTINUABLE_WITH_CPP_LATEST) + target_compile_options(continuable-features-flags + INTERFACE + /std:c++latest) +else() + target_compile_options(continuable-features-flags + INTERFACE + /std:c++14) +endif() + if (CTI_CONTINUABLE_WITH_NO_EXCEPTIONS) target_compile_definitions(continuable-features-noexcept INTERFACE diff --git a/test/playground/CMakeLists.txt b/test/playground/CMakeLists.txt index b8aa36d..6aa61fa 100644 --- a/test/playground/CMakeLists.txt +++ b/test/playground/CMakeLists.txt @@ -18,11 +18,10 @@ source_group(test FILES ${TEST}) target_link_libraries(test-playground PRIVATE gtest - continuable) - -target_compile_definitions(test-playground - PUBLIC - -DCONTINUABLE_WITH_NO_EXCEPTIONS) + continuable + continuable-features-flags + continuable-features-warnings + continuable-features-noexcept) add_test(NAME continuable-playground-tests COMMAND test-playground)