Build library to .a file, use multiple sketches with .a file #1473
Labels
topic: build-process
Related to the sketch build process
topic: code
Related to content of the project itself
type: enhancement
Proposed improvement
Moved here from this forum post.
Not sure if this is my lack of understanding, a [documentation] bug report or an enhancement request.
I would like to ask
arduino-cli
to:a) build my library, for a given architecture, to a
.a
file,b) build sketch x, linking it with the above
.a
file.c) build sketch y, linking it with the above
.a
file.I can see that the
dot_a_linkage
directive in the library file metadata will tellarduino-cli
to build the library to an intermediate.a
file but I can't see how I would tellarduino-cli
to just build the library for me, so not build a whole sketch but just build the library. The reason I would like to do this as a distinct step is to make sure that the library is built in "its own" way, any conditional compilation is decided by the library builder, not by some random application.And then, of course, how would I tell it to compile and then link a given sketch using that
.a
file rather than building the library from source (though I guess that might be automatic?)?I understand that I could do all of this manually (e.g. using an empty
.ino
file for (a) and then copying the resulting library.a
file somewhere or other), what I'm asking is whetherarduino-cli
can be told to perform these steps by itself; it is a perfectly normal/logical build operation to perform and it looks as thougharduino-cli
should be able to do it, I just can't figure out how.I suppose that what I really want is a
lib
command which compiles the library for the given platform. Job done.Environment
arduino-cli alpha Version: 0.19.0 Commit: 56419ecd Date: 2021-09-02T14:47:35Z
The text was updated successfully, but these errors were encountered: