Skip to content

hpps files have wrong cdb with json from cmake #271

@sezaru

Description

@sezaru

I have a project which have subprojects in it (each subproject have it own CMakeLists.txt)

For example, let's say I have this scenario:
project
....|____subproject1
....|____subproject2

project CMakeLists.txt only have add_subdirectory to subproject1 and 2.

Now, regarding irony-mode, when I open a cpp file, irony-mode will look in the json file cmake created to get the correct flags for it, and it works really great. But, when I open a hpp file, it looks like that irony-mode guesses what flags to use,.

For example, I have a file called NFSe.cpp which is part of subproject2 in directory project/subproject2/src, when I do irony-cdb-menu, the flags are right and the working directory is ../build/subproject2. But, when I open NFSe.hpp which is the header of NFSe.cpp, and is located in project/subproject2/includes, irony-mode stops working.

Running irony-cdb-mode, shows that the working directory for it is ../build/subproject1, and the flags to the compiler are wrong.

So, the problem is that the hpp files doesn't work since it thinks the project for this file is the wrong one and so gets the flags for the wrong project.

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