From 6881f6b03676fd841f787dc40b48eebce56ed655 Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Wed, 25 Feb 2026 16:22:44 +0100 Subject: (modules) strip embed-dir on clang / gcc --- xmake/rules/c++/modules/clang/support.lua | 3 ++- xmake/rules/c++/modules/gcc/support.lua | 3 ++- xmake/rules/c++/modules/support.lua | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xmake/rules/c++/modules/clang/support.lua b/xmake/rules/c++/modules/clang/support.lua index 9447d9c97..4bf5832a6 100644 --- a/xmake/rules/c++/modules/clang/support.lua +++ b/xmake/rules/c++/modules/clang/support.lua @@ -131,7 +131,8 @@ function strippeable_flags() "Q", "fmodule-file", "fPIC", - "fsanitize" + "fsanitize", + "embed-dir" } local splitted_strippeable_flags = { "I", diff --git a/xmake/rules/c++/modules/gcc/support.lua b/xmake/rules/c++/modules/gcc/support.lua index 623444ce4..4de7d6eab 100644 --- a/xmake/rules/c++/modules/gcc/support.lua +++ b/xmake/rules/c++/modules/gcc/support.lua @@ -91,7 +91,8 @@ function strippeable_flags() "fmodules-ts", "fmodules", "fPIC", - "fsanitize" + "fsanitize", + "embed-dir" } local splitted_strippeable_flags = { "I", diff --git a/xmake/rules/c++/modules/support.lua b/xmake/rules/c++/modules/support.lua index 1f23ae52a..0767c88af 100644 --- a/xmake/rules/c++/modules/support.lua +++ b/xmake/rules/c++/modules/support.lua @@ -120,6 +120,7 @@ function strip_flags(target, flags, opt) for _, flag in ipairs(splitted_strippeable_flags) do table.insert(strippeable_flags, flag) splitted_strippeable_flags_set:insert("/" .. flag) + splitted_strippeable_flags_set:insert("--" .. flag) splitted_strippeable_flags_set:insert("-" .. flag) end @@ -133,11 +134,11 @@ function strip_flags(target, flags, opt) strip_next_flag = false else for _, _flag in ipairs(strippeable_flags) do - if (flag == "/" .. _flag) or (flag == "-" .. _flag) then + if (flag == "/" .. _flag) or (flag == "--" .. _flag) or (flag == "-" .. _flag) then strip = true strip_next_flag = splitted_strippeable_flags_set:has(flag) break - elseif flag:startswith("/" .. _flag) or flag:startswith("-" .. _flag) then + elseif flag:startswith("/" .. _flag) or flag:startswith("--" .. _flag) or flag:startswith("-" .. _flag) then strip = true break end -- cgit v1.3.1