diff options
| author | ruki <[email protected]> | 2021-10-02 21:51:33 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-10-02 21:51:33 +0800 |
| commit | d4789ff5e968294bf2e9831209d0cf61b61c9d43 (patch) | |
| tree | 7f645f0532bf7888c714a2fef7059c3aa5443c17 /xmake/plugins | |
| parent | 8290bf21a9ba66cc4b253e39d716d715a7cfe466 (diff) | |
improve compile_commands
Diffstat (limited to 'xmake/plugins')
| -rw-r--r-- | xmake/plugins/project/clang/compile_commands.lua | 6 |
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 |
