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.
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:
I: found compilation database: <root>/out/Default/compile_commands.json
I: found by guessing: (((-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) . <root>/out/Default))
However, I'm getting some errors from flycheck that indicate it doesn't understand the -std=c++14 option:
6 10 error 'type_traits' file not found... (irony)
10 33 error no type named 'function' in namespace 'std'... (irony)
16 10 error no type named 'unique_ptr' in namespace 'std'... (irony)
The corresponding .cpp file seems totally fine.
One thing that does work is copying the compile_commands.json into <root>, clearing my cdb-json-projects, and then modifying the compile_commands.json file by hand to have a working directory corresponding to <root>.
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>
.