From b6e25d28c0568146f20c9d5380e97854121ae779 Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Mon, 9 Nov 2026 13:50:45 -0500 Subject: [PATCH] build(meson): added check to ensure that C++ static asserts are supported, if not supported then SERiF will auto fall back to old style, unformatted static asserts --- build-check/meson.build | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build-check/meson.build b/build-check/meson.build index 1e7611f1..60665110 100644 --- a/build-check/meson.build +++ b/build-check/meson.build @@ -15,6 +15,16 @@ if not cpp.links(''' error('SERiF requires C++23 std::println support. On macOS, use -Dmacos_deployment_target=15.0 or newer with a recent Xcode toolchain.') endif +if not cpp.compiles(''' + #include + int main() { + static_assert(__cpp_static_assert >= 202306L); + static_assert(false, std::format("C++26 static asserts {}", "supported")); + return 0; + } +''', name: 'C++26 user defined static assert strings') + message('Note: SERiF uses some C++26 features specifically 202306L (user defined strings for static asserts), these may not be supported by your compiler and standard library. SERiF will fallback to simpler compile time error messages, but this may make debugging more difficult.') + endif cmake_program = find_program('cmake', required: true) # With meson-python, the generated native file pins this to the interpreter # building the wheel. For command-line builds, PATH controls the selection.