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
So, as title says, it would be nice to add the original directory of the sketch file (before is copied to the temporary folder) to the include directories.
The motivation behind this is as follows. Usually, if you want to share code between sketches, you should make a library and then use it in both sketches. One of the problems is that, one should import the library manually if it wants to be able to compile the project.
But what if I want to share the code with another C++ project too, one which is not an Arduino project?
Here, sketch1 and sketch2 share the arduino.h file. Then, both sketches share also the common.h file with the other_non_arduino_project. To be able to do it, the original sketch directory should be added to the include directories such that, in the Arduino sketches I can use the following lines of code to include the common files. #include "../common/arduino.h" #include "../common/common.h"
Having this means that the builder does not need to copy the .h files anymore to the temporary directory.
I don't know if this is somehow a breaking change or how it would affect the entire building system of Arduino. I have already patched the arduino-builder locally, and it works just fine. Here you can find the commit on my fork: mihaizh@55f9599
What do you say? Is it worth it? Or is there a way, which I don't know yet about, to do it already?
The text was updated successfully, but these errors were encountered:
So, as title says, it would be nice to add the original directory of the sketch file (before is copied to the temporary folder) to the include directories.
The motivation behind this is as follows. Usually, if you want to share code between sketches, you should make a library and then use it in both sketches. One of the problems is that, one should import the library manually if it wants to be able to compile the project.
But what if I want to share the code with another C++ project too, one which is not an Arduino project?
I have the following directory structure:
Here,
sketch1
andsketch2
share thearduino.h
file. Then, both sketches share also thecommon.h
file with theother_non_arduino_project
. To be able to do it, the original sketch directory should be added to the include directories such that, in the Arduino sketches I can use the following lines of code to include the common files.#include "../common/arduino.h"
#include "../common/common.h"
Having this means that the builder does not need to copy the
.h
files anymore to the temporary directory.I don't know if this is somehow a breaking change or how it would affect the entire building system of Arduino. I have already patched the
arduino-builder
locally, and it works just fine. Here you can find the commit on my fork: mihaizh@55f9599What do you say? Is it worth it? Or is there a way, which I don't know yet about, to do it already?
The text was updated successfully, but these errors were encountered: