es-ude / EmbeddedSystemsBuildScripts

Bazel build scripts used for all projects of the embedded systems department
MIT License
4 stars 5 forks source link

Parse Avr include paths correctly on Windows #4

Open glencoe opened 5 years ago

glencoe commented 5 years ago

To find out which builtin include paths the compiler uses we issue the following command

avr-gcc -E -xc++ - -v

This returns very verbose output ending with a substring like this on windows:

#include <...> search starts here:
c:\path\to\avrtoolchain\bin\../lib/gcc/avr/5.4.0/include
c:\path\to\avrtoolchain\bin\../lib/gcc/avr/5.4.0/include-fixed
c:\path\to\avrtoolchain\bin\../lib/gcc/avr/5.4.0/include-fixed/.../.../.../.../avr/include

I think the line of code to look at first is this one. Maybe the path.strip function returns Null because of the path format with back and forward slashes mixed.