Merge pull request #239 from Foundation-Devices/baremetal

Use CARGO_CFG_TARGET_OS in build scripts.
This commit is contained in:
bunnie 2022-10-12 12:56:17 -07:00 committed by GitHub
commit 51752aac9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 10 deletions

View file

@ -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.

View file

@ -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

View file

@ -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

View file

@ -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.