Skip to content

Commit

Permalink
improve clang.tidy ##5538
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Sep 9, 2024
1 parent 76ab87b commit 5a1058f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion xmake/modules/private/check/checkers/clang/tidy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,21 @@ function _check(clang_tidy, opt)
opt = opt or {}

-- generate compile_commands.json first
local filepath = option.get("compdb") or "compile_commands.json"
local filepath = option.get("compdb")
if not filepath then
-- @see https://github.com/xmake-io/xmake/issues/5583#issuecomment-2337696628
local outputdir
local extraconf = project.extraconf("target.rules", "plugin.compile_commands.autoupdate")
if extraconf then
outputdir = extraconf.outputdir
end
if outputdir then
filepath = path.join(outputdir, "compile_commands.json")
end
end
if not filepath then
filepath = "compile_commands.json"
end
if not os.isfile(filepath) then
local outputdir = os.tmpfile() .. ".dir"
local filename = path.filename(filepath)
Expand Down

0 comments on commit 5a1058f

Please sign in to comment.