Skip to content

Commit

Permalink
update tivars_lib_cpp again and fix compile feature check
Browse files Browse the repository at this point in the history
  • Loading branch information
adriweb committed Jun 10, 2024
1 parent 9948e89 commit c776433
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gui/qt/CEmu.pro
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ TEMPLATE = app
# Localization
TRANSLATIONS += i18n/fr_FR.ts i18n/es_ES.ts i18n/nl_NL.ts i18n/zh_CN.ts

CONFIG += c++11 console
CONFIG += c++14 c++2a c++20 console

# Seems to fix some LTO issues. See https://github.com/CE-Programming/CEmu/issues/366
CONFIG += ltcg
Expand Down
18 changes: 15 additions & 3 deletions gui/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,22 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(USED_CMAKE_GENERATOR "${CMAKE_GENERATOR}" CACHE STRING "Expose CMAKE_GENERATOR" FORCE)
message(STATUS "Detected system: ${CMAKE_SYSTEM_NAME} - host processor: ${CMAKE_HOST_SYSTEM_PROCESSOR} - CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID}")

# C11 and C++14
# C11, and C++20 if supported otherwise C++14
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(CheckCXXCompilerFlag)
if(MSVC)
CHECK_CXX_COMPILER_FLAG("/std::c++20" COMPILER_SUPPORTS_CXX20)
else()
CHECK_CXX_COMPILER_FLAG("-std=c++2a" COMPILER_SUPPORTS_CXX20)
endif()
if(COMPILER_SUPPORTS_CXX20)
set(CMAKE_CXX_STANDARD 20)
add_definitions(-DTH_GDB_SUPPORT=1)
else()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()

# Sane flags
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
Expand Down Expand Up @@ -163,6 +174,7 @@ qt_add_executable(CEmu ${MAYBE_MACOSX_BUNDLE}
tivars_lib_cpp/src/TypeHandlers/STH_ExactRadical.cpp
tivars_lib_cpp/src/TypeHandlers/STH_FP.cpp
tivars_lib_cpp/src/TypeHandlers/STH_PythonAppVar.cpp
tivars_lib_cpp/src/TypeHandlers/TH_GDB.cpp
tivars_lib_cpp/src/TypeHandlers/TH_GenericAppVar.cpp
tivars_lib_cpp/src/TypeHandlers/TH_GenericComplex.cpp
tivars_lib_cpp/src/TypeHandlers/TH_GenericList.cpp
Expand Down
2 changes: 1 addition & 1 deletion gui/qt/tivars_lib_cpp

0 comments on commit c776433

Please sign in to comment.