Skip to content

xmake check clang.tidy doesn't follow non-default path to the compile_commands.json #5583

Closed
@yh-sb

Description

@yh-sb

Xmake Version

2.9.4

Operating System Version and Architecture

Windows 11 23H2 22631.4037

Describe Bug

Whet custom location to compile_commands.json is set (build/compile_commands.json), xmake check clang.tidy can't find it and creates new compile_commands.json each time:

clang-tidy -p C:\Users\Y\AppData\Local\Temp\.xmake\240907\_B4E95247014C4A708F2AA4B170AA47A0.dir\compile_commands.json ....

Expected Behavior

xmake check clang.tidy should use compile_commands.json created by xmake during the config or build steps.

Project Configuration

add_rules("mode.debug", "mode.release", "plugin.compile_commands.autoupdate", {outputdir = "build"})
set_targetdir("$(buildir)")

target("app")
    add_files(
        "main.cpp"
    )

Additional Information and Error Logs

Here is xmake lua code that checks compile_commands.json by hardcoded path:

if not os.isfile(filepath) then

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions