Closed sbroberg closed 8 years ago
I'm looking at your elisp now - it seems you're filtering the compiler commands to yield only includes & defines. But why not use the command as-is, trimming off the beginning and end parts that are inapplicable, instead of searching through the string to find the parts that are? In my project, there doesn't seem to be a problem including everything other than the last part of the command specifying the -o and -c options, which you would replace with the - < .
Relating to the other issue I filed (referenced above - #26 ) - I'm not sure why cmake-ide appears to be pulling in a union of all the include options for all files compiled in my project. I'm not well-versed in lisp, so I can't determine how the flycheck setting is derived, but I can't see how any invocation of cmake, regardless of directory, would result in the commands in the json file have all includes. Are you recursing through the included headers and adding the includes for their compilation units as well?
The reason I'm filtering is because flycheck uses different variables for includes and defines. Each package does its own thing, auto-complete-clang just takes all variables at once, so no filtering is needed there.
I don't remember any more why I thought filtering was a good idea, I'll change it to stuff everything that isn't includes and defines into flycheck-clang-args
I found out what the issue here is; the JSON output has to escape quotes to be valid JSON, but reading the file keeps all the extra backslashes that shouldn't be passed to the shell. I'm still figuring out how to fix this though
I fixed a similar issue with a project of mine. I'm not sure it'll fix your issue, though. Why is it
-DPRODVER_STRING="\"99.9.9d1 build 999 (2008-01-01 12:00:00)\""
Instead of simply:
-DPRODVER_STRING=\"99.9.9d1 build 999 (2008-01-01 12:00:00)\"
I think this is fixed now so closing.
Our compile line is specifying environment variables which are quoted strings containing spaces. When flycheck is trying to compile the file, the options are not being correctly handled, resulting in errors like:
Example (note the value specified for DPRODVER_STRING):
Actual compilation line for translation unit:
Compile line used by flycheck-compile: