如何使用相对路径进行铿锵?

Bap*_*cht 6 c++ static-analysis clang

我正在使用clang-tidy对我的C++代码进行一些分析.为此,我正在使用Clang JSON编译数据库.它正在开发机器上,但我不能在另一台机器上重用编译数据库,因为编译数据库中的所有路径都是绝对的,而另一台机器没有相同的当前工作目录.以下是JSON中的示例:

{
    "command": "clang++ -g -fprofile-arcs -ftest-coverage -Iinclude -std=c++1y -Wextra -Wall -Qunused-arguments -Wuninitialized -Wsometimes-uninitialized -Wno-long-long -Winit-self -Wdocumentation -pedantic -Iinclude -ICatch/include -Werror -MD -MF debug/test/algorithm.cpp.d -o debug/test/algorithm.cpp.o -c test/algorithm.cpp",
    "directory": "/home/wichtounet/dev/cpp_utils_test",
    "file": "test/algorithm.cpp"
},
Run Code Online (Sandbox Code Playgroud)

理想情况下,目录应该是当前的工作目录.我尝试用"."替换绝对目录路径.并让它空,并删除它,但没有任何效果.

目前,我唯一的解决方案是使用脚本用当前工作目录的路径替换所有以前的绝对路径,但这非常不实用......

是否可以在不同的机器上使用相同的编译数据库?