cmake: Use C++latest everywhere on MSVC.
This commit is contained in:
parent
dbee810a04
commit
89fadd26a6
|
@ -25,6 +25,14 @@ endif()
|
||||||
|
|
||||||
project(dolphin-emu)
|
project(dolphin-emu)
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std:c++latest")
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Name of the Dolphin distributor. If you redistribute Dolphin builds (forks,
|
# Name of the Dolphin distributor. If you redistribute Dolphin builds (forks,
|
||||||
# unofficial builds) please consider identifying your distribution with a
|
# unofficial builds) please consider identifying your distribution with a
|
||||||
# unique name here.
|
# unique name here.
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
if (NOT MSVC)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(SRCS
|
set(SRCS
|
||||||
source/ChannelMaps.cpp
|
source/ChannelMaps.cpp
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
|
|
||||||
# Compilers often don't use the latest C++ standard as the default. Periodically update this value (possibly conditioned
|
# Compilers often don't use the latest C++ standard as the default. Periodically update this value (possibly conditioned
|
||||||
# on compiler) as new standards are ratified/support is available
|
# on compiler) as new standards are ratified/support is available
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
if (NOT MSVC)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
endif()
|
||||||
|
|
||||||
project(witest.cpplatest)
|
project(witest.cpplatest)
|
||||||
add_executable(witest.cpplatest)
|
add_executable(witest.cpplatest)
|
||||||
|
|
|
@ -15,9 +15,12 @@ endif()
|
||||||
if(POLICY CMP0063)
|
if(POLICY CMP0063)
|
||||||
cmake_policy(SET CMP0063 NEW)
|
cmake_policy(SET CMP0063 NEW)
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_C_STANDARD 99)
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
if (NOT MSVC)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT COMMAND add_sanitizers)
|
if(NOT COMMAND add_sanitizers)
|
||||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/sanitizers-cmake/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/sanitizers-cmake/cmake")
|
||||||
|
|
|
@ -4,7 +4,9 @@ option(ENABLE_IO_THREAD "Start up a separate I/O thread, otherwise I'd need to c
|
||||||
option(USE_STATIC_CRT "Use /MT[d] for dynamic library" OFF)
|
option(USE_STATIC_CRT "Use /MT[d] for dynamic library" OFF)
|
||||||
option(WARNINGS_AS_ERRORS "When enabled, compiles with `-Werror` (on *nix platforms)." OFF)
|
option(WARNINGS_AS_ERRORS "When enabled, compiles with `-Werror` (on *nix platforms)." OFF)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
if (NOT MSVC)
|
||||||
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(BASE_RPC_SRC
|
set(BASE_RPC_SRC
|
||||||
${PROJECT_SOURCE_DIR}/include/discord_rpc.h
|
${PROJECT_SOURCE_DIR}/include/discord_rpc.h
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
if (NOT MSVC)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(SRCS
|
set(SRCS
|
||||||
imgui.cpp
|
imgui.cpp
|
||||||
|
|
|
@ -18,15 +18,12 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
add_definitions(-D_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING)
|
add_definitions(-D_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MSVC)
|
if (NOT MSVC)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
|
||||||
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std:c++latest")
|
|
||||||
else()
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
|
|
Loading…
Reference in New Issue