Skip to content

Add top-level library path to include search path when compiling libraries. #2448

Closed
@WestfW

Description

@WestfW

Currently, the list of Include-file paths ("-I" compiler option) is computed based on the sketch files (#include strings), and the libraries themselves. For instance, to compile a ds1307 example (which uses the I2C "Wire" library), you have to have a #include "Wire.h" in your main sketch even though that sketch never accesses Wire function directly, because otherwise the ds1307 library has no idea where the wire library might be.

If the "top-level" of the library directories (/libraries and /Arduino/libraries, I guess) were put in the Include search paths WHEN COMPILING USER LIBRARIES, the libraries could easily do "#include "Wire/Wire.h"" to get their secondary dependancies, without having to rely on the end users knowing about them.

(Offhand, it seems like it would be a bad idea to include these paths for non-user-library compiles, but I can't quite quantify why...)

Metadata

Metadata

Assignees

Labels

Type: DuplicateAnother item already exists for this topic

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions