-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libdefs: a way for user to configure libraries #1517
Conversation
hi @d-a-v
It will come as an expansion to this RFC and configuration will happen in the |
@d-a-v |
@ubidefeo Thanks for reviewing ! The new system you're working on looks promising and shall allow to automate builds in a more fluent way than today, for users who are used to Through my attempts, my objective is similar to part of what describes the RFC in your link above, but they don't have the same goal. The single issue I'm trying to address is about that having to modify a library with different parameters for different sketches is counter-productive. I must say that my proposals #1117 and #1517 are directed to the arduino-GUI users, so it can be easier for a anyone (beginners) to configure large libraries, such as those which do not provide user functions for setting up internals, thus heavily relying on cpp-defines to "configure" the code. Now thanks to your review, I'm coming back again with a third attempt which is even simpler because it requires no changes from libraries which are already supporting overrides. It is an optional, generic, universal and (=> your favorite superlative <=) per-sketch configuration file (link is below). |
While our RFC is focused on the CLI, our final goal is to expose GUI elements which will allow a user to set custom #define fields, which are themselves not exactly aligning to the "Arduino simplicity contract". For a beginner, having to create a folder on the Sketch level, means finding the Sketch folder and creating folder Anyway if you feel your solution is the one we should go for, it need to be peer reviewed, in which case you can submit a full RFC to the RFC repo I posted above, you can find the rules of this RFC Repo here This is the process, but as I said we're getting there and we will support the option to properly define macros without having to ask developers of Libraries to do anything they aren't yet doing |
This is true and I have much simplified this in #1524 which requires no other change in the current tools. No need to ask or change anything from libraries, a regular per-project GUI-editable header file backward compatible with a number of libraries. Also compatible with Arduino 1.8. I will close this PR and #1117 and see if #1524 finds your interest. |
Please check if the PR fulfills these requirements
before creating one)
our contributing guidelines
This proposal gives the ability for any sketch to use additional configuration files for libraries that are aware of this feature.
This is yet another proposal for #846 and arduino/Arduino#421: Compiler flags are not addressed, global defines for sketch and libraries is the target.
It would additionally replace and close #1117.
A library source file (header or code) could optionally use this kind of snippet:
CoolLibrary/CoolLibrary.h
CoolLibrary/CoolLibrary.cpp
A sketch using this library can create a local subdirectory called
libdefs/
and store, in this specific case, a file namedCoolLibrary_user_config.h
. Name and content of this file need to match the specific library requirements.The goal for the library maintainer is to willingly allow users to change default values, or provide some specific configuration (like
#define COOLLIBRARY_DEBUG_MODE
) without having to force users to modify the library files (header or code). #1117 may give more details on the same subject with additional examples.For security, files added in
libdefs/
are accessible during the compilation phases of libraries and sketch, but not when core source files are involved.