- 
    Bug 
- 
    Resolution: Done
- 
    P3: Somewhat important 
- 
    Qt Creator 4.9.0-beta1
- 
    None
- 
        a0072afd492d9653d035b3217ddda954154b2d24 (qt-creator/qt-creator/4.9)
Sourcetrail is a very cool cross-platform source explorer for C/C++.
There is a Qt Creator plugin to support Sourcetrail, but it can also load a compile_commands.json which Qt Creator is able to generate since 4.8.
 Sourcetrail is able to load the 4.8 version of compile_commands.json but unfortunately not the 4.9-beta1 version.
compile_commands.json (4.8.0):
[
{
    "arguments": [
        "clang++",
        "-c",
        "-m32",
        "-target",
        "i686-pc-windows-msvc",
...
compile_commands.json (4.9-beta1):
[
{
    "arguments": [
        "clang++",
        "--driver-mode=cl",
        "-nologo",
        "-Zc:wchar_t",
        "-FS",
The difference seems to be the --driver-mode=cl entry introduced in 4.9.
This is the error message in Sourcetrail:
 
I created a Sourcetrail task.
Let's assume that both variants of the compile_commands.json are valid. Would it be possible to have some user options for generating the file? Either when generating or global? I could think of choice of:
- "arguments" lists vs. "command" value
- driver mode
- Filename (with current path as default)
| For Gerrit Dashboard: QTCREATORBUG-21936 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 255604,2 | Clang: Improve compilation database generation | 4.9 | qt-creator/qt-creator | Status: MERGED | +2 | 0 | 
