summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-10-02 21:51:33 +0800
committerruki <[email protected]>2021-10-02 21:51:33 +0800
commitd4789ff5e968294bf2e9831209d0cf61b61c9d43 (patch)
tree7f645f0532bf7888c714a2fef7059c3aa5443c17
parent8290bf21a9ba66cc4b253e39d716d715a7cfe466 (diff)
improve compile_commands
-rw-r--r--xmake/plugins/project/clang/compile_commands.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua
index eb30a1ee4..085d230ae 100644
--- a/xmake/plugins/project/clang/compile_commands.lua
+++ b/xmake/plugins/project/clang/compile_commands.lua
@@ -35,7 +35,11 @@ end
function _translate_arguments(arguments)
local args = {}
local is_msvc = path.basename(arguments[1]):lower() == "cl"
- for _, arg in ipairs(arguments) do
+ for idx, arg in ipairs(arguments) do
+ -- see https://github.com/xmake-io/xmake/issues/1721
+ 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")
elseif arg:find("[%-/]external:I") then