From 54ca5c23a09a54ca970721ae0cf9c7f53239dd56 Mon Sep 17 00:00:00 2001 From: Adam Macdonald Date: Thu, 17 Apr 2025 14:47:17 +0100 Subject: [PATCH] explicitly require CXX_STANDARD=23, mainly for abseil --- CMakeLists.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 114b966..e8bb56d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,11 @@ project( LANGUAGES CXX ) +# Required by Kuiper Engine, but needs to be explicitly specified for Abseil, at least +set(CMAKE_CXX_STANDARD 23) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + add_library( kuiper STATIC @@ -30,7 +35,13 @@ add_library( src/renderer/gl_renderer.cpp src/window/input_system.cpp ) -target_compile_features(kuiper PRIVATE cxx_std_23) + +target_compile_features(kuiper PUBLIC cxx_std_23) +if(CXX_STANDARD LESS 23) + message(FATAL_ERROR + "Kuiper Engine requires CXX_STANDARD >= 23 (got: ${CXX_STANDARD})") +endif() + target_include_directories(kuiper PUBLIC "include/") # Compiler options @@ -191,6 +202,8 @@ FetchContent_Declare( FetchContent_MakeAvailable(flecs) # Abseil C++ +set(ABSL_BUILD_TESTING OFF CACHE BOOL "" FORCE) + FetchContent_Declare( abseil GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git