From 7686be1b232a1d143c83d1efe6e94ea95be9e14d Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:09:47 +0000 Subject: [PATCH] chore(build): containers, toolchains and portability fixes --- cmake/Capabilities.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/Capabilities.cmake b/cmake/Capabilities.cmake index c56c254..aafd88a 100644 --- a/cmake/Capabilities.cmake +++ b/cmake/Capabilities.cmake @@ -33,7 +33,7 @@ function(void_probe_capabilities) endif() cmake_push_check_state(RESET) - set(CMAKE_REQUIRED_FLAGS "-std=c++26") + set(CMAKE_REQUIRED_FLAGS "-std=c++${CMAKE_CXX_STANDARD}") check_cxx_source_compiles( "#include \nint main() { std::expected e{0}; return *e; }\n" VOID_HAS_STD_EXPECTED @@ -46,10 +46,12 @@ function(void_probe_capabilities) endif() cmake_push_check_state(RESET) - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16) - set(CMAKE_REQUIRED_FLAGS "-std=c++26 -freflection") + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND + CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16 AND + CMAKE_CXX_STANDARD GREATER_EQUAL 26) + set(CMAKE_REQUIRED_FLAGS "-std=c++${CMAKE_CXX_STANDARD} -freflection") else() - set(CMAKE_REQUIRED_FLAGS "-std=c++26") + set(CMAKE_REQUIRED_FLAGS "-std=c++${CMAKE_CXX_STANDARD}") endif() check_cxx_source_compiles( "#include \nconsteval bool probe() { constexpr auto r = ^^int; return std::meta::is_type(r); }\nstatic_assert(probe());\nint main() { return 0; }\n"