mirror of https://github.com/PCSX2/pcsx2.git
Build: Require C++20
This commit is contained in:
parent
296dcccd81
commit
ad0190d6ed
|
@ -134,6 +134,10 @@ add_compile_options("${ARCH_FLAG_LIST}")
|
||||||
option(USE_PGO_GENERATE "Enable PGO optimization (generate profile)")
|
option(USE_PGO_GENERATE "Enable PGO optimization (generate profile)")
|
||||||
option(USE_PGO_OPTIMIZE "Enable PGO optimization (use profile)")
|
option(USE_PGO_OPTIMIZE "Enable PGO optimization (use profile)")
|
||||||
|
|
||||||
|
# Require C++20.
|
||||||
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
if(MSVC AND NOT USE_CLANG_CL)
|
if(MSVC AND NOT USE_CLANG_CL)
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
"$<$<COMPILE_LANGUAGE:CXX>:/Zc:externConstexpr>"
|
"$<$<COMPILE_LANGUAGE:CXX>:/Zc:externConstexpr>"
|
||||||
|
@ -270,18 +274,7 @@ if(NOT CMAKE_GENERATOR MATCHES "Xcode")
|
||||||
# Assume Xcode builds aren't being used for distribution
|
# Assume Xcode builds aren't being used for distribution
|
||||||
# Helpful because Xcode builds don't build multiple metallibs for different macOS versions
|
# Helpful because Xcode builds don't build multiple metallibs for different macOS versions
|
||||||
# Also helpful because Xcode's interactive shader debugger requires apps be built for the latest macOS
|
# Also helpful because Xcode's interactive shader debugger requires apps be built for the latest macOS
|
||||||
if (QT_BUILD)
|
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14)
|
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14)
|
||||||
else()
|
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET AND "${CMAKE_OSX_DEPLOYMENT_TARGET}" VERSION_LESS 10.14 AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 9)
|
|
||||||
# Older versions of the macOS stdlib don't have operator new(size_t, align_val_t)
|
|
||||||
# Disable use of them with this flag
|
|
||||||
# Not great, but also no worse that what we were getting before we turned on C++17
|
|
||||||
add_compile_options(-fno-aligned-allocation)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# CMake defaults the suffix for modules to .so on macOS but wx tells us that the
|
# CMake defaults the suffix for modules to .so on macOS but wx tells us that the
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DisableSpecificWarnings>4063;4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4063;4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<MinimalRebuild>false</MinimalRebuild>
|
<MinimalRebuild>false</MinimalRebuild>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
|
Loading…
Reference in New Issue