Need mechanism to pass defines to library cpp files

wanderson:

bperrybap:
Libraries are not slaves to the user of the library.
The library code is compiled separately and the behavior you are seeing is
the expected behavior. This is how libraries work.

Yes, and if the Arduino environment was actually using libraries I would understand that I would have to use a different method to get around the problem, for instance letting a define specify which vesion of the library to link into the code; however, as you point out below, the Arduino libaries are not really libraries, but module of code that get included in the compile process.

As such something simply like would be nice.

#define ENTROPY_FLOAT

#include <Entropy.h>

All the other Arduino libraries like your Entropy library are still being treated like a library by the IDE.
The IDE doesn't create a library .a archive file for it but otherwise the library is being handled
very similar to a "normal" library.
The files in the library are each compiled separately from the users code (sketch files) and then
then the library objects are linked in with the users code.
(The library files are not included or merged into the same compilation unit as the users sketch)
The only difference between "real" libraries and what the IDE is doing
is that with the exception of the Arduino core library, the compiled objects in the other libraries
are not archived into a .a archive file before they are linked in.

--- bill