summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/plugins/project/clang/compile_commands.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua
index 2fed079f1..9435819df 100644
--- a/xmake/plugins/project/clang/compile_commands.lua
+++ b/xmake/plugins/project/clang/compile_commands.lua
@@ -137,12 +137,12 @@ function _translate_arguments(arguments)
end
end
end
- if arg == "-I" then
+ if arg and arg == "-I" then
is_include = true
end
-- ignore pch flags
-- https://github.com/xmake-io/xmake/issues/6710
- if arg == "-include-pch" or arg:endswith(".pch") then
+ if arg and (arg == "-include-pch" or arg:endswith(".pch")) then
arg = nil
end
if arg then