irony-mode icon indicating copy to clipboard operation
irony-mode copied to clipboard

Irony using wrong file, right directory from compile_commands.json

Open LukeFernandes opened this issue 6 years ago • 0 comments

I seem to have got Irony to work with a large project (RawTherapee), however when I try to open a file from a particular source directory, it loads the compile flags from the first file it sees (alphabetically) in that directory and not those of the actual file.

Build --->rtexif (JSON working directory) --------->rtgui (JSON working directory) --------->rtengine (JSON working directory)

Src ------>rtexif ---------->rtgui ---------->rtengine--->CA_correct_RT.cc ------------------------>etc. ------------------------>ipsharpen.cc ------------------------>etc. etc. 50-ish more cpp files here

When I load 'ipsharpen.cc', the compilation flags are those for 'CA_correct_RT.cc', which is the first rtengine file in the database. The same applies to all other files in rtengine AFAIK.

What's more, when I do 'M-x check-compile-options RET' (found from looking at issue #190) I get the same list of compile options and it says it found them by guessing. Shouldn't it find them properly?

And when I do (irony-cdb-json--find-best-prefix-path (irony-cdb-json--target-path) '("C:/code/repo-rt/rtengine")) I get nil, which I don't think is right, is it?

compile_commands.txt I've attached compile-commands.json (as a text file for upload).

LukeFernandes avatar Feb 03 '19 15:02 LukeFernandes