prevent -isystem-after flag and -isystem in path
@@ -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
