Hi
I got a crate:
https://github.com/elsuizo/static-math
that depends of the num
crate:
https://github.com/rust-num/num
and i want enable a feature in my crate for compile in a no-std environment, for this in the Cargo.toml
I have:
[dependencies]
num = { version = "0.4", default-features = false}
[features]
no-std = ["num/libm"]
default = ["num/std"]
also in lib.rs
#![cfg_attr(all(feature = "no-std"), no_std)]
this seems to work fine, but testing in a non-std environment I have an error, for example in the following test repo:
https://github.com/elsuizo/blinky-stm32f4
i have:
[dependencies.static-math]
path = "/home/elsuizo/Repos/static-math"
features = ["no-std"]
with the following error:
--> /home/elsuizo/.cargo/registry/src/github.com-1ecc6299db9ec823/num-traits-0.2.14/src/lib.rs:21:1
|
21 | extern crate std;
| ^^^^^^^^^^^^^^^^^ can't find crate
|
= note: the `thumbv7em-none-eabihf` target may not be installed
looking in that lines of code in the num-traits
repo:
#[cfg(feature = "std")]
extern crate std;
It seems to not have the flag properly enabled, but I don't know more to try. Any help is welcome. Thanks in advance