-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure when encountering compile options as quoted strings containing spaces #24
Comments
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 |
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
Instead of simply:
|
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:
The text was updated successfully, but these errors were encountered: