From d4789ff5e968294bf2e9831209d0cf61b61c9d43 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 2 Oct 2021 21:51:33 +0800 Subject: improve compile_commands --- xmake/plugins/project/clang/compile_commands.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.3.1