Skip to content
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

compileCommands setting does not appear to account for --sysroot/target options #1575

Open
imerin opened this Issue Feb 16, 2018 · 7 comments

Comments

Projects
None yet
4 participants
@imerin
Copy link

imerin commented Feb 16, 2018

* 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

@imerin imerin changed the title compile_commands.json does not appear to account for --sysroot option compileCommands setting does not appear to account for --sysroot option Feb 16, 2018

@sean-mcmanus

This comment has been minimized.

Copy link
Collaborator

sean-mcmanus commented Feb 16, 2018

We should be able to add support for --sysroot for the next update.

@sean-mcmanus sean-mcmanus self-assigned this Feb 16, 2018

@sean-mcmanus sean-mcmanus added this to the March 2018 milestone Feb 16, 2018

@bobbrow bobbrow modified the milestones: March 2018, April 2018 Mar 7, 2018

@sean-mcmanus sean-mcmanus removed the quick fix label Apr 4, 2018

@sean-mcmanus

This comment has been minimized.

Copy link
Collaborator

sean-mcmanus commented 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

This comment has been minimized.

Copy link
Author

imerin commented Apr 4, 2018

Thanks, that’s what i ended up doing until this is added to the extension.

@sean-mcmanus sean-mcmanus modified the milestones: April 2018, May 2018 Apr 17, 2018

@sean-mcmanus sean-mcmanus removed their assignment Apr 17, 2018

@sean-mcmanus sean-mcmanus modified the milestones: August 2018, Triage Jul 20, 2018

@sean-mcmanus sean-mcmanus changed the title compileCommands setting does not appear to account for --sysroot option compileCommands setting does not appear to account for --sysroot/target options Aug 10, 2018

@jimmyharris

This comment has been minimized.

Copy link

jimmyharris commented Aug 14, 2018

This also doesn't cover the -isystem flags either. (I needed to add all of those to my compilerPath for the tools to work as expected.

@sean-mcmanus

This comment has been minimized.

Copy link
Collaborator

sean-mcmanus commented Aug 14, 2018

@jimmyharris We should already handle isystem -- are you experiencing a bug with that? Can you give more details of when isystem isn't working? Something special might be causing it to fail to be parsed.

@jimmyharris

This comment has been minimized.

Copy link

jimmyharris commented Aug 14, 2018

It might be that I am having trouble getting visual studio to parse my commands database. All of the File entries are relative to the build folder where the compile database lives.

@sean-mcmanus

This comment has been minimized.

Copy link
Collaborator

sean-mcmanus commented Mar 14, 2019

Fixing #1755 might fix this too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.