diff options
| author | ruki <[email protected]> | 2026-02-26 10:27:06 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-26 10:27:06 +0800 |
| commit | c6811ca904356ef5439f3e6aff3c11b48e4903d8 (patch) | |
| tree | d41a9669759d6c4cda9b0f50af8e9626529709d0 | |
| parent | ac2563555fffdf2ce28baa6dab7c488574054f05 (diff) | |
| parent | 6881f6b03676fd841f787dc40b48eebce56ed655 (diff) | |
Merge pull request #7349 from Arthapz/add-embeddir-modules
(modules) strip embed-dir on clang / gcc
| -rw-r--r-- | xmake/rules/c++/modules/clang/support.lua | 3 | ||||
| -rw-r--r-- | xmake/rules/c++/modules/gcc/support.lua | 3 | ||||
| -rw-r--r-- | 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 |
