diff options
| author | ruki <[email protected]> | 2017-07-19 15:22:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-07-19 15:22:38 +0800 |
| commit | 9b9f7b171ad00c963213e6a985652ea05af8ad93 (patch) | |
| tree | e185e01e1cb69797a2942f8a051c6c2cd561e413 | |
| parent | f22b46466ebed2df42379172a31107e071b99979 (diff) | |
fix compile_commands plugin
| -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 |
