Open stsquad opened 9 years ago
After a bunch of experimentation this seems tricky to solve. In my version of the checker I had simply used source-original and relied on a :predicate to ensure we had saved the buffer. Then clang-check could be called normally and resolve everything. Because we are trying to maintain the on-the-fly checking we need to somehow ensure clang-check is called in the build-directory referenced in compile_commands.json. Maybe this means messing with default-directory while building up the command unless there is someway to define a prequel set of commands before running the checker.
FYI, in irony-mode I use the -working-directory DIR
compile option for the compile_commands.json
's directory. I don't remember this ever being an issue.
I have a feeling newer clang-checks are much better at picking up compile_commands.json. I'm trying to find out when this changed because I could remove a lot of the parsing junk if that is the case.
Due to the way the builder works around calling clang-check directly it will get confused by not being in the right build directory (e.g. in QEMU it fails to find config-target.h which is in the target build directory). I'm working on a fix to pass the build directory as an option.