Open russellmcc opened 9 years ago
What Emacs version do you have?
What does irony-cdb-menu tells you?
Is <root>
"a full/absolute path" or something abbreviated (e.g: ~/
)?
I have 24.4 from https://github.com/caskroom/homebrew-cask for mac.
irony-cdb-menu shows
Compilation Database: irony-cdb-json
Working Directory: <root>/out/Default
Compile Options: -MMD -MF obj/src/CoreAudioSDK/foo.CAStreamBasicDescription.o.d -I../../src -I../../src/CoreAudioSDK -fasm-blocks -mpascal-strings -Os -gdwarf-2 -arch x86_64 -std=c++14
[q] to quit
Yeah, <root>
is a full path. I haven't seen an abbreviation anywhere.
Thanks for looking into this!
I'm using ninja for a project, and I'm trying to get flycheck-irony working. It's looking really good so far, except for some strange problems with header files.
Here's my project layout:
This is the preferred layout for the ninja build tool. I generated compile_commands.json using ninja.
Since the compile_commands.json is in a separate build directory and not directly in the source directory or a parent, irony-cdb doesn't find it automatically. To add it, I used
irony-cdb-json-add-compile-commands-path
, I set the project root to "root", and the compile_commands.json appropriately.It seems like the
cdb-json-projects
file is correct:I ran the
check-compile-options
function that you provided here, output from the header file was:However, I'm getting some errors from flycheck that indicate it doesn't understand the
-std=c++14
option:The corresponding
.cpp
file seems totally fine.One thing that does work is copying the
compile_commands.json
into<root>
, clearing mycdb-json-projects
, and then modifying thecompile_commands.json
file by hand to have a working directory corresponding to<root>
.In addition to the flycheck problems, auto complete seems to not understand that we're in
std=c++14
either.