From 765545da42ac411eb438a8c04ccbaf3ca4005148 Mon Sep 17 00:00:00 2001 From: propelluo Date: Tue, 31 Mar 2026 11:17:14 +0800 Subject: [PATCH] =?UTF-8?q?GCC=20<=2010=20=E4=B8=8D=E6=94=AF=E6=8C=81=20-s?= =?UTF-8?q?td=3Dc++20=EF=BC=8C=E5=8F=AA=E6=94=AF=E6=8C=81=20-std=3Dc++2a?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8=E6=9E=84=E5=BB=BA=E5=89=AF=E6=9C=AC=E4=B8=AD?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E7=A1=AC=E7=BC=96=E7=A0=81=E7=9A=84=20cpp=5F?= =?UTF-8?q?args?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: propelluo --- libfuse/tst-build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libfuse/tst-build.sh b/libfuse/tst-build.sh index c3dfd16..82ec393 100755 --- a/libfuse/tst-build.sh +++ b/libfuse/tst-build.sh @@ -51,6 +51,12 @@ ensure_meson_version() { build_tool() { cp -r "$g_tool_dir" "$g_install_dir" && cd "$g_install_dir/libfuse" || return 1 + # GCC < 10 不支持 -std=c++20,只支持 -std=c++2a,在构建副本中去掉硬编码的 cpp_args + if ! cc -std=c++20 -x c++ -E /dev/null &>/dev/null; then + echo "=== patching build copy: compiler does not support -std=c++20 ===" + sed -i "/cpp_args\s*:\s*'-std=c++20'/d" example/meson.build + fi + echo "=== meson setup ===" meson setup build -Dtests=true -Dexamples=true -Dutils=true \ || return 1 -- Gitee