From db0cf4529f62741f0238981af83deb0dd06e3c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Tue, 12 Dec 2023 16:46:25 +0100 Subject: [PATCH] Make use of intrinsics a feature-flag --- Cargo.toml | 3 ++- build.rs | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7f65a06..6ee61f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,4 +19,5 @@ cc = "1" [features] assertions = [] trace = [] -malloc = [] \ No newline at end of file +malloc = [] +software-intrinsics = [] diff --git a/build.rs b/build.rs index c8d27d7..0cbeccd 100644 --- a/build.rs +++ b/build.rs @@ -11,8 +11,10 @@ fn main() -> Result<(), Box> { .flag("-DLFS_NO_ERROR") .file("littlefs/lfs.c") .file("littlefs/lfs_util.c") - .file("string.c") - ; + .file("string.c"); + + #[cfg(feature = "software-intrinsics")] + let builder = builder.flag("-DLFS_NO_INTRINSICS"); #[cfg(not(feature = "assertions"))] let builder = builder.flag("-DLFS_NO_ASSERT");