diff options
| -rw-r--r-- | xmake/plugins/project/clang/compile_commands.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua index 3b3b65105..446f51279 100644 --- a/xmake/plugins/project/clang/compile_commands.lua +++ b/xmake/plugins/project/clang/compile_commands.lua @@ -39,16 +39,15 @@ function _make_object(jsonfile, target, sourcefile, objectfile) end -- get compile arguments - local arguments = table.join(compiler.compargv(sourcefile, {target = target, sourcekind = sourcekind})) + local arguments = table.join(compiler.compargv(sourcefile, objectfile, {target = target, sourcekind = sourcekind})) -- make body jsonfile:printf( [[%s{ "directory": "%s", "arguments": ["%s"], - "file": "%s", - "output": "%s" -}]], ifelse(_g.firstline, "", ",\n"), os.projectdir(), table.concat(arguments, "\", \""), sourcefile, objectfile) + "file": "%s" +}]], ifelse(_g.firstline, "", ",\n"), os.projectdir(), table.concat(arguments, "\", \""), sourcefile) -- clear first line marks _g.firstline = false |
