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
It is often desirable that the sketch author might need to pass some #define into a library or into the core to "configure" the build process for that component. For example, they may wish to turn on debug functions within a library, or specify that some section should not be compiled, or provide a non-default constant value such as say an i2c address... while many of these things could be done "at runtime" on an embedded platform this is often at best undesirably wasteful and at worst impossible simply due to program memory constraints.
In boards.txt we have the ability to set "build.extra_flags", this can even be done based on menu entries
I propose that it would be advantageous to have the sketch file, as part of the pre-processing, parsed for some "special" #defines which are then extracted and appended to build.extra_flags, in effect passing them into gcc for the entire compilation process of libraries and core for the sketch. Thereby making it possible for the sketch to easily set such configurations as mentioned above.
It is often desirable that the sketch author might need to pass some
#define
into a library or into the core to "configure" the build process for that component. For example, they may wish to turn on debug functions within a library, or specify that some section should not be compiled, or provide a non-default constant value such as say an i2c address... while many of these things could be done "at runtime" on an embedded platform this is often at best undesirably wasteful and at worst impossible simply due to program memory constraints.In boards.txt we have the ability to set "build.extra_flags", this can even be done based on menu entries
I propose that it would be advantageous to have the sketch file, as part of the pre-processing, parsed for some "special" #defines which are then extracted and appended to build.extra_flags, in effect passing them into gcc for the entire compilation process of libraries and core for the sketch. Thereby making it possible for the sketch to easily set such configurations as mentioned above.
For example, perhaps:
#define BUILD_CONFIG ZORT
#define BUILD_CONFIG NARF=23
in the sketch file could result in appending to build.extra_flags
-DZORT -DNARF=23
The text was updated successfully, but these errors were encountered: