ezieragabriel / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Build process fails with pre-processor conditionals #792

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Create a sketch with

#if 0
#include <lib1.h>
#else
#include <lib2.h>
#endif

The Arduino build process will build and link both lib1 and lib2.

Arduino IDE 1.0, 0023, 0022, 0021 and probably before.
Linux.

You probably ought to run g++ -E (ignoring all errors) and scan the resulting 
output for the files it has included, then remove all the libraries again from 
the build process that are not actually used (or something along those lines).

Original issue reported on code.google.com by gooc...@top.geek.nz on 15 Jan 2012 at 9:29

GoogleCodeExporter commented 9 years ago
Please give a try to the IDEs linked at the bottom of this email on the dev list
https://groups.google.com/a/arduino.cc/forum/#!msg/developers/4X2T3rCxXWM/YNJl6P
ZuDucJ
We're testing a new preprocessor and it compiles your sketch just fine.

Original comment by federico...@gmail.com on 28 Jan 2015 at 4:21

GoogleCodeExporter commented 9 years ago
New preprocessor tracked at https://github.com/arduino/Arduino/pull/2636. 
Builds for testing it are available

Original comment by federico...@gmail.com on 13 Feb 2015 at 7:18