arduino-builder icon indicating copy to clipboard operation
arduino-builder copied to clipboard

Adding support for sketch-specific build properties

Open stevemarple opened this issue 10 years ago • 9 comments
trafficstars

Tests for existence of a build_props.txt file in the sketch directory. If present reads properties similar to those found in the hardware and board files, allowing the user to easily customise the build for a specific sketch. Most useful when containing lines similar to

compiler.c.extra_flags=-D NDEBUG
compiler.cpp.extra_flags=-D NDEBUG -D MYLIBRARY_BUFSIZE=100

which enables the user to have macros defined for all compilation units, including libraries.

Signed-off-by: Steve Marple [email protected]

stevemarple avatar Oct 05 '15 11:10 stevemarple

One point of consideration: adding sketch-specific build properties allows the user to override build.path (which is removed when all compilation units must be rebuilt), commands such as compiler.cmd and paths such as compiler.path. Sketches and their build_props.txt file taken from untrusted sources could therefore be considered harmful. This could be mitigated by requiring a user-preference to be set before sketch-specific build properties are enabled. Alternatively the properties could be limited to a subset (eg by excluding *.path, *.cmd, and recipe.*).

stevemarple avatar Oct 05 '15 11:10 stevemarple

Addresses #15

stevemarple avatar Oct 05 '15 11:10 stevemarple

Assigning to @cmaglie: he will explain why such external defines are considered harmful

ffissore avatar Oct 05 '15 12:10 ffissore

btw, nice code, thank you very much

ffissore avatar Oct 05 '15 12:10 ffissore

ping.. nothing happened.. are you going to merge this, or not ?

FrankBoesing avatar Apr 28 '16 20:04 FrankBoesing

Hey, @arduino, @ffissore, @cmaglie ... I think this pull request implements a very useful and missing feature - what do you think about merging it?

luelista avatar Sep 09 '17 18:09 luelista

@max-weller sorry you missed the news. I no longer work for arduino https://groups.google.com/a/arduino.cc/forum/#!msg/developers/YJLX6AZHem4/kpsLef7XBAAJ

ffissore avatar Sep 11 '17 07:09 ffissore

+1

ricardojlrufino avatar Aug 21 '18 15:08 ricardojlrufino

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 09 '21 13:04 CLAassistant