From 164062f80dd7ca558dee0bdc4c05b40b4dd26e53 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 11 Apr 2024 13:46:25 +1000 Subject: [PATCH] Build: Use C++20 for everything except reshadefx --- CMakeLists.txt | 8 ++------ dep/msvc/vsprops/Base.props | 2 +- dep/reshadefx/CMakeLists.txt | 4 ++++ dep/reshadefx/reshadefx.vcxproj | 1 + src/common/common.props | 1 - 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40b1dc7b2..fb6a376de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -223,17 +223,13 @@ endif() # Prevent fmt from being built with exceptions, or being thrown at call sites. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFMT_EXCEPTIONS=0") -# Use C++17 for building dependencies (some aren't C++20-aware, e.g. reshadefx). -set(CMAKE_CXX_STANDARD 17) +# Use C++20. +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) # Recursively include the source tree. include(DuckStationDependencies) add_subdirectory(dep) - -# Use C++20 for building the main libraries. -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) add_subdirectory(src) if(ANDROID) diff --git a/dep/msvc/vsprops/Base.props b/dep/msvc/vsprops/Base.props index 7a7eda29e..9d485d4e4 100644 --- a/dep/msvc/vsprops/Base.props +++ b/dep/msvc/vsprops/Base.props @@ -25,7 +25,7 @@ true ProgramDatabase true - stdcpp17 + stdcpp20 true _HAS_EXCEPTIONS=0;_CRT_INTERNAL_NONSTDC_NAMES;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions) %(AdditionalIncludeDirectories);$(DepsIncludeDir) diff --git a/dep/reshadefx/CMakeLists.txt b/dep/reshadefx/CMakeLists.txt index 4224d8f21..5bc21fbd9 100644 --- a/dep/reshadefx/CMakeLists.txt +++ b/dep/reshadefx/CMakeLists.txt @@ -27,3 +27,7 @@ target_include_directories(reshadefx INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include" ) +# reshadefx is not C++20-compatible. +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + diff --git a/dep/reshadefx/reshadefx.vcxproj b/dep/reshadefx/reshadefx.vcxproj index 67d8dec14..8042bd2f7 100644 --- a/dep/reshadefx/reshadefx.vcxproj +++ b/dep/reshadefx/reshadefx.vcxproj @@ -33,6 +33,7 @@ TurnOffAllWarnings $(ProjectDir)src;$(ProjectDir)include;$(ProjectDir)..\spirv-cross\include\spirv-cross;%(AdditionalIncludeDirectories) + stdcpp17 diff --git a/src/common/common.props b/src/common/common.props index b5ff5ce6a..ea9990faa 100644 --- a/src/common/common.props +++ b/src/common/common.props @@ -4,7 +4,6 @@ $(SolutionDir)src;%(AdditionalIncludeDirectories);$(SolutionDir)dep\fast_float\include;$(SolutionDir)dep\fmt\include %(PreprocessorDefinitions);FMT_EXCEPTIONS=0 - stdcpp20