mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-08 04:56:43 +00:00
xous: Use CARGO_CFG_TARGET_OS in build scripts.
This allows for a more reliable detection of target_os configuration in build scripts. The target is inconsistent between some architectures, notably armv7a is `armv7a-none-eabi` skipping the `unknown` (the vendor, I guess) part. This happen with some of the unrelated Cortex-M targets present, and others may also be. Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
This commit is contained in:
parent
006a7cc8a6
commit
955fbc8788
4 changed files with 5 additions and 10 deletions
|
|
@ -10,10 +10,9 @@ use std::path::PathBuf;
|
|||
fn main() {
|
||||
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
let target = env::var("TARGET").unwrap();
|
||||
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
|
||||
let name = env::var("CARGO_PKG_NAME").unwrap();
|
||||
|
||||
let target_os = target.split('-').nth(2).unwrap_or("none");
|
||||
|
||||
// If we're not running on a desktop-class operating system, emit the "baremetal"
|
||||
// config setting. This will enable software to do tasks such as
|
||||
// managing memory.
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
use std::env;
|
||||
|
||||
fn main() {
|
||||
let target = env::var("TARGET").unwrap();
|
||||
|
||||
let target_os = target.split('-').nth(2).unwrap_or("none");
|
||||
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
|
||||
|
||||
// If we're not running on a desktop-class operating system, emit the "baremetal"
|
||||
// config setting. This will enable software to do tasks such as
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
use std::env;
|
||||
|
||||
fn main() {
|
||||
let target = env::var("TARGET").unwrap();
|
||||
|
||||
let target_os = target.split('-').nth(2).unwrap_or("none");
|
||||
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
|
||||
|
||||
// If we're not running on a desktop-class operating system, emit the "baremetal"
|
||||
// config setting. This will enable software to do tasks such as
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
use core::panic;
|
||||
// NOTE: Adapted from cortex-m/build.rs
|
||||
use std::env;
|
||||
use std::fs;
|
||||
|
|
@ -6,10 +7,9 @@ use std::path::PathBuf;
|
|||
fn main() {
|
||||
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
let target = env::var("TARGET").unwrap();
|
||||
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
|
||||
let name = env::var("CARGO_PKG_NAME").unwrap();
|
||||
|
||||
let target_os = target.split('-').nth(2).unwrap_or("none");
|
||||
|
||||
// If we're not running on a desktop-class operating system, emit the "baremetal"
|
||||
// config setting. This will enable software to do tasks such as
|
||||
// managing memory.
|
||||
|
|
|
|||
Loading…
Reference in a new issue