File tree 1 file changed +15
-1
lines changed
xmake/modules/private/check/checkers/clang
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,21 @@ function _check(clang_tidy, opt)
120
120
opt = opt or {}
121
121
122
122
-- generate compile_commands.json first
123
- local filepath = option .get (" compdb" ) or " compile_commands.json"
123
+ local filepath = option .get (" compdb" )
124
+ if not filepath then
125
+ -- @see https://github.com/xmake-io/xmake/issues/5583#issuecomment-2337696628
126
+ local outputdir
127
+ local extraconf = project .extraconf (" target.rules" , " plugin.compile_commands.autoupdate" )
128
+ if extraconf then
129
+ outputdir = extraconf .outputdir
130
+ end
131
+ if outputdir then
132
+ filepath = path .join (outputdir , " compile_commands.json" )
133
+ end
134
+ end
135
+ if not filepath then
136
+ filepath = " compile_commands.json"
137
+ end
124
138
if not os .isfile (filepath ) then
125
139
local outputdir = os .tmpfile () .. " .dir"
126
140
local filename = path .filename (filepath )
You can’t perform that action at this time.
0 commit comments