-
Notifications
You must be signed in to change notification settings - Fork 463
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
Can not compile active file if definition has quoted text #969
Comments
The problem appears to be in the argument splitting logic where the current token is cleared when a quote char is encountered. vscode-cmake-tools/src/shlex.ts Line 57 in de7672c
This might not have ever worked in the extension. Thanks for reporting it! |
Looks like this is the same as issue #605 |
It's much easier to just let the shell do its job via |
I think I have a similar problem where compile_commands.json contains:
Build all works fine, but "cmake compile active file" does not.
If I paste the command into terminal myself, it also fails.
Pasting this into terminal works fine. |
in particular macro definitions containing quotes and spaces fixes microsoft#969 microsoft#1221
in particular macro definitions containing quotes and spaces fixes microsoft#969 fixes microsoft#1221
in particular macro definitions containing quotes and spaces fixes microsoft#969 fixes microsoft#1221
We almost have CMake Tools 1.6.0 release out the door. Until then, if you want, you can also verify if this problem has been fixed correctly by installing the vsix built here: https://github.com/microsoft/vscode-cmake-tools/actions/runs/557242002#artifacts. |
Brief Issue Summary
If CMakeLists.txt has any C++ definition with ampersands char it brokes compiling active file.
It does not mater what kind of cmake command used no one of
add_definitions
,add_compile_definitions
nortarget_compile_definitions
.Apparent Behavior:
Just add in the file
First try configure the project and check
compile_commands.json
to ensure that it was correctly processed in compilers option-D_WRONG_CHAR_=\"'&'\"
And you can successfully build entire project as expected.
But if you try run compile only one active file with command
cmake.compileFile
you will get an error, because this definition will lost first part and leave only"'&'"
Expected:
Compile active file should use the same command from
compile_commands.json
as it was used to compile entire project.Other Notes
Originally the issue was noticed with following cmake code:
To set
__FILENAME__
in relative path of current sorce file.Platform and Versions
The text was updated successfully, but these errors were encountered: