Description
I am trying to use a precompiled library but the build system does not recognize it properly.
The reason: I am mixing Rust code into an Arduino sketch.
I compile the Rust code into a static library and then link this library into the Arduino sketch.
To link it, I put the Rust library in the Arduino library folder with a proper library.properties
file and directory structure.
This works perfectly for Teensy 3.5 and 4 boards.
I tried to do it for an STM32 board (specifically, a Nucleo L432KC), with the following library.properties
file:
name=rust-main-lib
version=1.0.0
author=Massimiliano Mantione <[email protected]>
maintainer=Massimiliano Mantione <[email protected]>
sentence=A library to test Arduino-rust integration
paragraph=Just a test
category=Communication
url=http://github.com/massimiliano-mantione
architectures=*
includes=rust-main-lib.h
precompiled=true
ldflags=-lrust-main-lib
where find rust-main-lib
from the Arduino libraries directory gives the following:
rust-main-lib
rust-main-lib/src
rust-main-lib/src/cortex-m4
rust-main-lib/src/cortex-m4/librust-main-lib.a
rust-main-lib/src/rust-main-lib.h
rust-main-lib/library.properties
but the build process terminates with the following error message:
Compiling libraries...
Compiling library "rust-main-lib"
Using library rust-main-lib at version 1.0.0 in folder: /home/massi/Arduino/libraries/rust-main-lib
stat /home/massi/Arduino/libraries/rust-main-lib/src/cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard: no such file or directory
Error compiling for board Nucleo-32.
The message is confusing: the cortex-m4
directory is there, and it contains the precompiled library.
When doing the same for the Teensy boards if I did not create the CPU-specific directory the error message was the proper one (it could not find the library file).
How can this be fixed?
Or, if this is not the proper repository where to file the issue, where should I file it?