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?
请先登录再写评论。
Hi Dean!
Could you please show one of your compilation commands?
I typically run autoreconf, configure, and make.
Dean, could you please provide one of the "command" values from your JSON compilation database?
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"
},
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