I've been developing a library for Arduino and now I'd like to add some precompiler options with the use of #ifdef's. I'm not sure about how Arduino links libraries with sketch but I'm learning that #defines placed in the sketch are not taken into account by the library:
#define precomp1 #include "mylibrary.h"
#ifdef precomp1 //Code block 1 ... #endif
In the above example, "Code block 1" is not taken into account so I guess that mylibrary is compiled before evaluating mysketch.pde. In order to make the above precompiler options work I always have to place "#define precomp1" in mylibrary.cpp but this forces me to edit the library source code each time I want a special compilation.
Is there any way to do what I intend?
Thanks in advance.