From d2f919876d3f087a64fe24aaa9ddd4e2d2315d94 Mon Sep 17 00:00:00 2001 From: t1amak Date: Thu, 19 Mar 2026 15:27:43 +0100 Subject: [PATCH] Stop redefining static_assert for C++ cross-builds --- CMakeLists.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14926ca..b77971d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -806,12 +806,11 @@ else() set(STATIC_ASSERT_FLAG "-Dstatic_assert=_Static_assert") endif() - try_compile(STATIC_ASSERT_CPP_RES "${CMAKE_CURRENT_BINARY_DIR}/static-assert" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/test-static-assert.cpp" CMAKE_FLAGS -DCMAKE_CXX_STANDARD=11) - if(STATIC_ASSERT_CPP_RES) - set(STATIC_ASSERT_CPP_FLAG "") - else() - set(STATIC_ASSERT_CPP_FLAG "-Dstatic_assert=_Static_assert") - endif() + # Cross try_compile has been observed to incorrectly fail for some C++ toolchains + # even though the compiler fully supports C++11 static_assert. Remapping + # static_assert breaks modern libstdc++/Boost headers, so keep the C fallback + # only and never redefine static_assert for C++. + set(STATIC_ASSERT_CPP_FLAG "") monero_enable_coverage() # With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that