forked from M-Labs/rust-fatfs
Fix std build
This commit is contained in:
parent
26972b9458
commit
3dc332d8c8
@ -20,8 +20,8 @@ travis-ci = { repository = "rafalh/rust-fatfs" }
|
||||
[features]
|
||||
# Use Rust std library
|
||||
std = []
|
||||
# Use dynamic allocation - required for LFN support
|
||||
alloc = ["core_io/collections"]
|
||||
# Use dynamic allocation - required for LFN support. When used without std please enable core_io/collections
|
||||
alloc = []
|
||||
# Default features
|
||||
default = ["chrono", "std", "alloc"]
|
||||
|
||||
|
@ -48,7 +48,7 @@ Put this in your `Cargo.toml`:
|
||||
[dependencies]
|
||||
fatfs = { version = "0.2", features = ["core_io"], default-features = false }
|
||||
|
||||
Note: LFN support requires `alloc` feature and makes use of `alloc` crate.
|
||||
Note: LFN support requires `alloc` and `core_io/collections` features and makes use of `alloc` crate.
|
||||
You may have to provide a memory allocator implementation.
|
||||
|
||||
For building in `no_std` mode nightly Rust version compatible with current `core_io` crate is required.
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
cargo build --no-default-features --features core_io
|
||||
cargo build --no-default-features --features core_io,alloc
|
||||
cargo build --no-default-features --features core_io,alloc,core_io/collections
|
||||
|
@ -22,7 +22,6 @@ extern crate chrono;
|
||||
extern crate core_io;
|
||||
|
||||
#[cfg(all(not(feature = "std"), feature = "alloc"))]
|
||||
#[macro_use]
|
||||
extern crate alloc;
|
||||
|
||||
mod fs;
|
||||
@ -31,7 +30,7 @@ mod dir_entry;
|
||||
mod file;
|
||||
mod table;
|
||||
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(all(feature = "alloc"))]
|
||||
mod utils;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
@ -54,5 +53,5 @@ pub use dir::*;
|
||||
pub use dir_entry::*;
|
||||
pub use file::*;
|
||||
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(all(feature = "alloc"))]
|
||||
pub use utils::*;
|
||||
|
Loading…
Reference in New Issue
Block a user