xmake project -k compile_commands does not respect outputdir
Xmake Version
v2.9.8+20250204
Operating System Version and Architecture
Linux archlinux 6.13.6
Describe Bug
When your root xmake.lua contains
add_rules("plugin.compile_commands.autoupdate", {outputdir = "$(buildir)", lsp = "clangd"})
and then executing
xmake project -k compile_commands later, the compile_commands are put into the cwd.
Expected Behavior
the outputdir of the rule should be applied
Project Configuration
add_rules("plugin.compile_commands.autoupdate", {outputdir = "$(buildir)", lsp = "clangd"})
Additional Information and Error Logs
[raildex@archlinux project]$ ls | grep "compile_commands"
[raildex@archlinux project]$ ls ./build | grep "compile_commands"
[raildex@archlinux project]$ xmake project -k compile_commands --lsp=clangd
create ok!
[raildex@archlinux project]$ ls ./build | grep "compile_commands"
[raildex@archlinux project]$ ls | grep "compile_commands"
compile_commands.json
[raildex@archlinux project]$
add_rules("plugin.compile_commands.autoupdate", {outputdir = "$(buildir)", lsp = "clangd"})
xmake project -k compile_commands later, the compile_commands are put into the cwd.
These two are completely independent and unrelated, don't mix them up.
plugin.compile_commands.autoupdate rule will run xmake project -k compile_commands command automatically after building project.
xmake project -k compile_commands command will not use this rule.