automatic inclusion of sketch_globals.h for sketch.ino and libraries#1524
automatic inclusion of sketch_globals.h for sketch.ino and libraries#1524d-a-v wants to merge 4 commits intoarduino:masterfrom
sketch_globals.h for sketch.ino and libraries#1524Conversation
|
I'd suggest renaming to:
|
proj_globals.h for proj.ino and librariessketch_globals.h for sketch.ino and libraries
|
Before merging this, please consider the long term effect on the Arduino ecosystem. Historically, Arduino has rejected this idea. If it's now considered okay, then great. |
|
I can't see any adverse effect for backward compatibility. |
|
Having a single |
|
I think a way for using global defines is really lacking in the Arduino build system for a user point of view, in the same sense where in any other build environment that I know of, there is always a place where one can add some custom #defines, which are enabled in a global manner. Allowing to use a separate and distinct file per library is an interesting idea, which indeed would avoid name clashing. Having a single file named after user's sketch appears more simple to me, and sticks to the Arduino simplicity. About library name clashing, this is indeed an issue. |
before creating one)
our contributing guidelines
User is given the ability to add local overriding for cpp-defines used by sketch and libraries.
This is done through a new and optional user file editable from Arduino-GUI and which must stand beside
someSketch.inounder the namesomeSketch_globals.h.When it exists, this file is automatically included first in all compilation units (
.ino,.cpp) through the compiler's-include filecommand line option.This is yet another proposal for #846 and arduino/Arduino#421, and follows #1117 and #1517.
Features:
follows #1517 (comment) .