Compiler flags containing spaces not passed correctly to IntelliSense
See original GitHub issueBrief Issue Summary
Using custom CMake toolchain which is referenced in project-local kit .vscode\cmake-kits.json
:
[
{
"name": "arm-gcc from CMake Toolchain",
"toolchainFile": "${workspaceRoot}/cmake/arm-gcc-toolchain.cmake"
}
]
Intellisense is configured via .vscode\settings.json
to receive configuration from cmake-tools:
{
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
}
The cmake toolchain succeeds in locating the compiler and cmake-tools receives the compiler information, after I implemented the cmake cache workaround. The project build works as expected.
However, Intellisense C++ fails to locate the standard C library include files and marks the #include
statements with squiggles.
The arm-gcc toolchain is on a Windows machine on a C:\Program Files (x86)\...
path, thus containing a whitespace.
When I move it to C:\arm-gnu-toolchain
, eliminating the whitespace in the path, and reconfigure the project, then IntelliSense works and the affected #include
files are found.
I assume the compiler path is not passed correctly from cmake-tools to IntelliSense, maybe there are quotes missing somewhere along the way.
Platform and Versions
- Operating System: Windows
- CMake Version: 3.17.4
- VSCode Version: 1.48.0
- CMake Tools Extension Version: 1.4.1
- Compiler/Toolchain: arm-none-eabi-gcc 6.3.1.508
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (8 by maintainers)
This is perfect! Thanks for the logs. It looks like the problem is with this compiler flag:
"--sysroot=C:/Program Files (x86)/GNU Arm Embedded Toolchain/9 2020-q2-update/bin/../arm-none-eabi"
. When it is passed to the compiler probe it messes things up because the path is not quoted.We will provide a VSIX soon with this fix so that you can test it with your scenario. I will update you.