summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGly <[email protected]>2022-08-11 01:59:05 +0200
committerGly <[email protected]>2022-08-11 01:59:05 +0200
commit720fce958cb8bfe0546ef5246c4928000766ca11 (patch)
tree93e6d0326c3f7cbca8e3e109a97a82530f86558b
parent234d674bd244799e51342c44d0f34dba2577a516 (diff)
prevent -isystem-after flag and -isystem in path
-rw-r--r--xmake/plugins/project/clang/compile_commands.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua
index 04416439a..70692eef4 100644
--- a/xmake/plugins/project/clang/compile_commands.lua
+++ b/xmake/plugins/project/clang/compile_commands.lua
@@ -44,8 +44,10 @@ function _translate_arguments(arguments)
if idx == 1 and is_host("windows") and path.extension(arg) == "" then
arg = arg .. ".exe"
end
- if arg:startswith("-isystem", 1, true) then
- arg = arg:replace("-isystem", "-I")
+ if arg:startswith("-isystem-after", 1, true) then
+ arg = "-I" .. arg:sub(13, -1)
+ elseif arg:startswith("-isystem", 1, true) then
+ arg = "-I" .. arg:sub(9, -1)
elseif arg:find("[%-/]external:I") then
arg = arg:gsub("[%-/]external:I", "-I")
elseif arg:find("[%-/]external:W") or arg:find("[%-/]experimental:external") then