Stop redefining static_assert for C++ cross-builds
Some checks failed
build / ARM v7 (push) Failing after 9m12s
build / i686 Linux (push) Failing after 1m7s
build / RISCV 64bit (push) Has been cancelled
build / x86_64 Freebsd (push) Has been cancelled
build / i686 Win (push) Has been cancelled

This commit is contained in:
t1amak
2026-03-19 15:27:43 +01:00
parent abe6cd5927
commit d2f919876d

View File

@@ -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