Generated compile_commands.json commands are surrounded by parantheses
I have a peculiar issue with the generated compile_commands.json file. When building my project (Mbed OS based) the commands are showing up like this:
"command": "( C:\\PROGRA~2\\GNUARM~1\\92020-~1\\bin\\AR19DD~1.EXE <options redacted> -c C:\\<path redacted>\\mbed-os-example-blinky\\main.cpp )"
Note the parantheses at the beginning and and at the end. This of course breaks other tools which depend on the commands.
The issue is, I cannot reproduce this on a simple CMake project. Therefore I don't know what is causing the issue. One remarkable aspect of the Mbed OS project is that all of the configurations are added as compiler options, which result in a huge amount of compiler options. To be specific, a command can be more than 20,000 characters long. I suspect that this could be causing the issue. I can't think of any other project-specific CMake configuration that would cause this.
If you don't mind installing the tooling, feel free to build the Mbed OS blinky example to reproduce the issue. Apart from that I could not come up of a easy way of generating so many compiler options to test my hypothesis.
- OS: Windows
- CMake version: 3.20.3