gpp icon indicating copy to clipboard operation
gpp copied to clipboard

Add support for "sysroot"

Open duncanmac99 opened this issue 6 years ago • 1 comments

In the GNU C pre-processor, an argument called '-isysroot' (or '--sysroot', depending on circumstances) is allowed to specify the first part of the path or paths used in '-I' arguments. Any given '-I' argument may then reference the path given in the "sysroot" argument by starting the path with an '='. If either of those arguments appear on the compiler command line, it is used for both the pre-processor and the linker (for libraries); if both appear, the '-isysroot' argument is given to the pre-processor, and the other one goes to the linker.

Not clear is what happens if there is more than one '--sysroot' argument on the command-line, or whether that argument must appear before or after the '-I' arguments.

Support for just the '--sysroot' argument would make sense and allow paths given to each '-I' argument to be shorter.

duncanmac99 avatar Sep 15 '18 22:09 duncanmac99

If we are running under Windows/DOS, we may want to incorporate support for the Windows call "GetSystemDirectory". For more details:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms724373(v=vs.85).aspx

duncanmac99 avatar Sep 17 '18 15:09 duncanmac99