Skip to content

Commit 03a61e3

Browse files
committed
build: use C++20 now that we're 5 years in and CI uses 2022+ runners.
1 parent a56d979 commit 03a61e3

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

gui/qt/CEmu.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ TEMPLATE = app
6060
# Localization
6161
TRANSLATIONS += i18n/fr_FR.ts i18n/es_ES.ts i18n/nl_NL.ts i18n/zh_CN.ts
6262

63-
CONFIG += c++14 c++2a c++20 console
63+
CONFIG += c++2a c++20 console
6464

6565
# Seems to fix some LTO issues. See https://github.com/CE-Programming/CEmu/issues/366
6666
CONFIG += ltcg

gui/qt/CMakeLists.txt

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,10 @@ set(CMAKE_SKIP_RPATH TRUE)
4848
set(USED_CMAKE_GENERATOR "${CMAKE_GENERATOR}" CACHE STRING "Expose CMAKE_GENERATOR" FORCE)
4949
message(STATUS "Detected system: ${CMAKE_SYSTEM_NAME} - host processor: ${CMAKE_HOST_SYSTEM_PROCESSOR} - CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID}")
5050

51-
# C11, and C++20 if supported otherwise C++14
5251
set(CMAKE_C_STANDARD 11)
5352
set(CMAKE_C_STANDARD_REQUIRED ON)
54-
include(CheckCXXCompilerFlag)
55-
if(MSVC)
56-
CHECK_CXX_COMPILER_FLAG("/std:c++20" COMPILER_SUPPORTS_CXX20)
57-
else()
58-
CHECK_CXX_COMPILER_FLAG("-std=c++2a" COMPILER_SUPPORTS_CXX20)
59-
endif()
60-
if(COMPILER_SUPPORTS_CXX20)
61-
set(CMAKE_CXX_STANDARD 20)
62-
add_definitions(-DTH_GDB_SUPPORT=1)
63-
else()
64-
set(CMAKE_CXX_STANDARD 14)
65-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
66-
endif()
53+
set(CMAKE_CXX_STANDARD 20)
54+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6755

6856
# Sane flags
6957
if(MSVC)
@@ -251,6 +239,7 @@ target_compile_definitions(CEmu PRIVATE
251239
CEMU_VERSION=\"${SHORT_VERSION}${VERSION_SUFFIX}\"
252240
DEBUG_SUPPORT
253241
MULTITHREAD
242+
TH_GDB_SUPPORT=1
254243
)
255244

256245
if(CYGWIN OR NOT WIN32)

0 commit comments

Comments
 (0)