Skip to content

Possibility of compiling static libraries with the cli #1407

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

Open
victorChB opened this issue Aug 23, 2021 · 1 comment
Open

Possibility of compiling static libraries with the cli #1407

victorChB opened this issue Aug 23, 2021 · 1 comment
Assignees
Labels
topic: build-process Related to the sketch build process topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@victorChB
Copy link

victorChB commented Aug 23, 2021

I was wondering if it's possible to compile a static library (.a) with the arduino-cli and specify the SDK I want to use (e.g. avr, esp32, due,etc).

My current use case is the following:

I have a library for Arduino which will be built for different platforms and distributed as a static lib, which in the library.properties file is set with precompiled=true. Since the library is targeted for Arduino I am using the Arduino SDK of each platform. This brings me to the case where I need to include the core libraries for each platform, compiler flags, toolchain, etc. As I understand the arduino-cli detects the installed toolchains and one can select the platform for which the Sketch will be compiled. In my case I would like to make the compiled objects into a static lib instead of an hex,elf or bin.

I currently use the Arduino-Cmake-toolchain where I can specify which SDK I want to use (esp32,avr,due,nano,etc) and then it parses the platforms.txt and boards.txt file to allow me to use the specific toolchain and compiler flags. Afterward, I have a pipeline that creates a new build for each target with CMake, and voila I have all the static libraries for each platform/cpu which I then use with a script to create the library for Arduino according to its specification.

If its not possible at the moment I was wondering if this will be in the roadmap of the project?

@silvanocerza
Copy link
Contributor

Nope, it's not on our roadmap but it's certainly an interesting use case. I'll leave this open for future references and to keep track any future work that might happen.

@silvanocerza silvanocerza added the type: enhancement Proposed improvement label Sep 14, 2021
@per1234 per1234 added the topic: code Related to content of the project itself label Mar 7, 2022
@FStefanni FStefanni mentioned this issue Nov 14, 2022
3 tasks
@umbynos umbynos added the topic: build-process Related to the sketch build process label Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: build-process Related to the sketch build process topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

4 participants