From fb0fefc75c3cb9e060d59f3b10fe3ae66626aeb8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 10 Jul 2020 19:24:23 -0400 Subject: CMakeLists: Make use of /std:c++latest on MSVC Provides the buildbot with one builder that is always tracking the latest version of the C++ standard, allowing us to progressively rectify our code and amend any differences between standards over time instead of waiting for a complete standard change, potentially breaking a lot of code all at once. --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c0e49c03..c8e86959b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,8 +118,15 @@ message(STATUS "Target architecture: ${ARCHITECTURE}") # Configure C++ standard # =========================== -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +if (MSVC) + add_compile_options(/std:c++latest) + + # cubeb and boost still make use of deprecated result_of. + add_definitions(-D_HAS_DEPRECATED_RESULT_OF) +else() + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() # Output binaries to bin/ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) -- cgit v1.2.3