You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
compileCommands setting does not appear to account for --sysroot/target options #1575
* Ubuntu 16.04
* VS Code version 1.20.1
* C/C++ extension version 0.15.0
I'm cross compiling and using the --sysroot option with gcc. The extension does not seem to account for this when loading the compile_commands.json file. It correctly includes the header paths specified with the -I option to gcc, but does not include the headers in e.g. sysroot/usr/include.
Removing all entries from both includePath and browse.path did not fix this issue.
Adding the sysroot/usr/include directories to includePath gave me the functionality I was expecting from the compileCommands setting
changed the title [-]compile_commands.json does not appear to account for --sysroot option[/-][+]compileCommands setting does not appear to account for --sysroot option[/+]on Feb 16, 2018
We haven't added --sysroot parsing to compile_commands.json yet, but as an alternative you might be able to set the compilerPath and add the --sysroot arg , assuming all your files use the same sysroot arg.
Activity
[-]compile_commands.json does not appear to account for --sysroot option[/-][+]compileCommands setting does not appear to account for --sysroot option[/+]sean-mcmanus commentedon Feb 16, 2018
We should be able to add support for --sysroot for the next update.
sean-mcmanus commentedon Apr 4, 2018
We haven't added --sysroot parsing to compile_commands.json yet, but as an alternative you might be able to set the compilerPath and add the --sysroot arg , assuming all your files use the same sysroot arg.
imerin commentedon Apr 4, 2018
Thanks, that’s what i ended up doing until this is added to the extension.
6 remaining items
sean-mcmanus commentedon Mar 14, 2019
Fixing #1755 might fix this too.
abmantis commentedon Apr 6, 2020
I can also confirm that the isystem paths in compile_commands.json do not take into account the --sysroot param.
sean-mcmanus commentedon Jan 21, 2021
Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/1.2.0-insiders2