Skip to content

Commit

Permalink
Switch to c++ 23 standard (#1985)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhog authored Mar 9, 2025
1 parent 4b29412 commit 95d591b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
11 changes: 4 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.27)
cmake_policy(SET CMP0060 OLD) #causes link errors on Linux otherwise
cmake_policy(SET CMP0065 OLD) #we need binaries compiled with -rdynamic for BARb to work (cause unknown https://github.com/beyond-all-reason/spring/issues/405)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_MODULES_SPRING "${CMAKE_CURRENT_SOURCE_DIR}/rts/build/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_MODULES_SPRING}")

Expand Down Expand Up @@ -362,13 +366,6 @@ else (LDGOLD_FOUND)
message(WARNING "You are using ld.bfd, it's much slower than ld.gold.")
endif (LDGOLD_FOUND)

message(STATUS "Compiling with C++20")
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++20 /permissive- /Zc:__cplusplus")
else (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
endif(MSVC)

add_definitions(-D_GLIBCXX_USE_NANOSLEEP) # issue in std::chrono with gentoo and few other distros


Expand Down
4 changes: 0 additions & 4 deletions rts/Rendering/Fonts/ustring.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

#include <string>

#if __cplusplus < 202002L
using char8_t = unsigned char;
#endif

namespace spring {
class u8string : public std::string {
public:
Expand Down

0 comments on commit 95d591b

Please sign in to comment.