4. Write a small program the prepends the #line to the start of each temp file created by arduino-builder.
Good hint. And even no program needed. Just to put the #line directive at the begin of each project source file. For example:
#line 2 "D:\\KomplexCB\\_Vysilani_100\\Komplex00\\Adafruit_HDC1000.cpp"
And it works 8) But with complete absolute path only. :(
I wanted to use builtin variable:
#line 2 "$(PROJECT_DIR)Adafruit_HDC1000.cpp"
or somehow to make it universal but it doesn't work.
Is it possible to do it? Or the prepocessor doesn't accept C::B variables?
For completeness: If I use
it refers to the temp again
C:\Users\zdena\AppData\Local\Temp\Komplex00\build\sketch\Adafruit_HDC1000.cpp
Variable expansion does not happen in the code, only in command lines....
If you are hardcore you could probably create a squirrel pre build step http://wiki.codeblocks.org/index.php/Scripting_commands
In the attached archive you will find an example project:
Basically it replaces all occurrences of
to
#line 1 CURRENT_ABSOLUTE_FILENAME
the problem is, this is a onetime shot... It literally replaces the line, so it wont work a second time.
It would probably be possible to create a script that creates temporary files and copy it to somewhere, but this is really out of scope...
The easiest thing would be to modify the arduino builder... i mean, they make the bullshit by copying files around...