Skip to content

Commit

Permalink
fix target_arch build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
2ndTaleStudio committed Aug 12, 2019
1 parent 41e7651 commit c016c8c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
13 changes: 5 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "ruspiro-cache"
authors = ["Andre Borrmann <[email protected]>"]
version = "0.1.0" # remember to update html_root_url
version = "0.1.1" # remember to update html_root_url
description = "Raspberry Pi cache maintenance operation API"
license = "Apache-2.0"
repository = "https://github.com/RusPiRo/ruspiro-cache/tree/v0.1.0"
documentation = "https://docs.rs/ruspiro-cache/0.1.0"
repository = "https://github.com/RusPiRo/ruspiro-cache/tree/v0.1.1"
documentation = "https://docs.rs/ruspiro-cache/0.1.1"
readme = "README.md"
keywords = ["RusPiRo", "baremetal", "raspberrypi", "cache"]
categories = ["no-std", "embedded"]
Expand All @@ -27,8 +27,5 @@ default = ["ruspiro_pi3"]
ruspiro_pi3 = []

[package.metadata.docs.rs]
all-features = true
rustc-args = [
"-C target-cpu=cortex-a53",
"-C target-feature=+a53,+fp-armv8,+v8,+vfp3,+d16,+thumb2,+neon"
]
all-features = false
no-default-features = true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ to ensure access to the most recent values stores in the memory.
To use the crate just add the following dependency to your ``Cargo.toml`` file:
```
[dependencies]
ruspiro-cache = "0.1.0"
ruspiro-cache = "0.1.1"
```

Once done the access to the cache maintenance functions is available like so:
Expand Down
21 changes: 12 additions & 9 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ extern crate cc;
use std::env;

fn main() {
let build_pi3 = env::var_os("CARGO_FEATURE_RUSPIRO_PI3").is_some();
if build_pi3 {
#[cfg(target_arch="arm")]
cc::Build::new()
.file("src/asm/cache.s")
.flag("-march=armv8-a")
.flag("-mfpu=neon-fp-armv8")
.flag("-mfloat-abi=hard")
.compile("cache");
match env::var_os("CARGO_CFG_TARGET_ARCH") {
Some(target_arch) => {
if target_arch == "arm" && env::var_os("CARGO_FEATURE_RUSPIRO_PI3").is_some() {
cc::Build::new()
.file("src/asm/cache.s")
.flag("-march=armv8-a")
.flag("-mfpu=neon-fp-armv8")
.flag("-mfloat-abi=hard")
.compile("cache");
}
},
_ => ()
}
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Author: André Borrmann
* License: Apache License 2.0
**********************************************************************************************************************/
#![doc(html_root_url = "https://docs.rs/ruspiro-cache/0.1.0")]
#![doc(html_root_url = "https://docs.rs/ruspiro-cache/0.1.1")]
#![no_std]
#![feature(asm)]

Expand Down

0 comments on commit c016c8c

Please sign in to comment.