diff --git a/libfuse/tst-build.sh b/libfuse/tst-build.sh index c3dfd16314146f40a5c8ed1dfe53de2f37e33219..82ec393ffb61485a041137f9da36a41840ade8c4 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