How can I clean up the compiler-file*.d files from the compilation database?

已回答

I created a compilation database for a large C  project.  So far it's been working well, but my directories are filling up with compiler-file*.d files.  Is there a way to clean them up?

0

Hi Dean!

Could you please show one of your compilation commands? 

0

I typically run autoreconf, configure, and make.

0

Dean, could you please provide one of the "command" values from your JSON compilation database?

{ "directory": "/Users/me/prj/Calendar/",
"command": "/usr/local/bin/g++-7 -I/Users/me/prj/Calendar/calendars -g -std=c++11 -o calendar_run.dir/main.cpp.o -c /Users/me/prj/Calendar/main.cpp",
"file": "/Users/me/prj/Calendar/main.cpp" }
0

Here's a typical entry from compile_commands.json:

{
"directory": "/home/dean/src/slurm.versions/slurm-19.05/slurm-19.05.4-liqid.select.plugin/src/sacctmgr",
"arguments": [
"gcc",
"-DHAVE_CONFIG_H",
"-I.",
"-I../..",
"-I../../slurm",
"-I../..",
"-g",
"-O2",
"-pthread",
"-ggdb3",
"-Wall",
"-g",
"-O1",
"-fno-strict-aliasing",
"-MT",
"cluster_functions.o",
"-MD",
"-MP",
"-MF",
".deps/cluster_functions.Tpo",
"-c",
"-o",
"cluster_functions.o",
"cluster_functions.c"
],
"file": "cluster_functions.c"
},

 

 

0

Hi Dean,

Thanks for your compilation command! I was able to reproduce and analyze the problem.

The core problem is in `-MD` flag that forces GCC to generate dependency file `compiler-file*.d` while CLion is collecting compiler information. Currently, CLion only filters out `-MF` option, but seems that we missed `-MD` and `-MMD` options.

I created a ticket for this bug: https://youtrack.jetbrains.com/issue/CPP-19417

0

请先登录再写评论。