summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-08-12 10:41:57 +0800
committerGitHub <[email protected]>2022-08-12 10:41:57 +0800
commitbe3bab756494bd895943d115b05d0c32c6d42128 (patch)
tree5d2ded51fad100ea6311bd10a075b8eaf2733694
parentae1521c83b8d19b832b1fb1636ae2c22c299cac8 (diff)
parentc7d932ea12a0fa61951c1fd9f6d87e2674aa0569 (diff)
Merge pull request #2668 from glcraft/dev
In project.clang, replace -isystem by -I only if it starts with.
-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 20b096a4c..ce2dfcd30 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:find("-isystem", 1, true) then
- arg = arg:replace("-isystem", "-I")
+ if arg:startswith("-isystem-after", 1, true) then
+ arg = "-I" .. arg:sub(15)
+ elseif arg:startswith("-isystem", 1, true) then
+ arg = "-I" .. arg:sub(9)
elseif arg:find("[%-/]external:I") then
arg = arg:gsub("[%-/]external:I", "-I")
elseif arg:find("[%-/]external:W") or arg:find("[%-/]experimental:external") then