Skip to content

A fix for header files in compile_commands.json #13

@sezaru

Description

@sezaru

Hello there,

First of all, I'm not sure if I should post this here or in the cedet-maillists, I decided to do it here since I didn't found any information about ede-compdb in the cedet website.

This post is about the compile_commands.json file, and it's lack of information about header files.

In your wiki, I found that ede-compdb try some workarounds to guess the compiler flags of a header file based on the flags of another similar source file. This works fine in some small projects, but any more complex project and problems start to arise.

So I've made some simple changes to the cmake source code to insert the header compiler flags information in the compile_command.json file, any header files that are listed in the CMakeLists.txt file will be included in the json file with it`s correct compiler flags, fixing the issue completly.

I've made a issue report in the cmake's bug tracker about this issue, but I'm not sure it will be accepted and mainstreamed.. the link is https://gitlab.kitware.com/cmake/cmake/issues/16285, maybe, if you are interested, you can comment there to help me convince the cmake devs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions