Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header files completion when using Cmake to generate a compilation database #323

Open
jvillasante opened this issue Aug 3, 2016 · 2 comments

Comments

@jvillasante
Copy link

I'm using CMake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON to generate a compile_commands.json for my project. Irony works well for .cpp files but not for .h files. It seems that CMake doesn't include header files in the compile_commands.json file, but I'm still asking here in case that there is a workaround.

@Sarcasm
Copy link
Owner

Sarcasm commented Aug 4, 2016

Hello,

The question is on point.
I'm working on a tool to solve this issue: https://github.com/Sarcasm/compdb

For example, to have a compilation database with headers for irony-mode, one can do this:

mkdir build
cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ../server
mkdir /tmp/irony-headerdb
compdb headerdb -p . > /tmp/irony-headerdb/compile_commands.json
compdb dump -p . -p /tmp/irony-headerdb/ > ../server/compile_commands.json
emacs ../server/src/Irony.h
# M-x irony-cdb-menu RET

It's more complex than it needs to be but still somewhat usable.

@albusshin
Copy link

I'm curious, what's the current status of this issue? Is this work still ongoing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants