Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Maroon502 committed Mar 21, 2023
1 parent 6027370 commit 3029fc4
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
use std::env;
use std::path::{Path, PathBuf};

use coin_build_tools::{utils, link, coinbuilder};
use coin_build_tools::{coinbuilder, link, utils};

const LIB_NAME: &str = "CoinUtils";

fn main() {
println!("cargo:rerun-if-changed={}_lib_sources.txt", LIB_NAME.to_ascii_lowercase());
println!("cargo:rerun-if-env-changed=CARGO_{}_STATIC", LIB_NAME.to_ascii_uppercase());
println!("cargo:rerun-if-env-changed=CARGO_{}_SYSTEM", LIB_NAME.to_ascii_uppercase());
println!(
"cargo:rerun-if-changed={}_lib_sources.txt",
LIB_NAME.to_ascii_lowercase()
);
println!(
"cargo:rerun-if-env-changed=CARGO_{}_STATIC",
LIB_NAME.to_ascii_uppercase()
);
println!(
"cargo:rerun-if-env-changed=CARGO_{}_SYSTEM",
LIB_NAME.to_ascii_uppercase()
);

let want_system = utils::want_system(LIB_NAME);

if want_system && link::link_lib_system_if_supported(LIB_NAME) {
let coinflags = vec!["COINUTILS".to_string()];
coinbuilder::print_metedata(Vec::new(), coinflags);
coinbuilder::print_metedata(Vec::new(), coinflags);
return;
}

Expand All @@ -28,14 +37,13 @@ fn build_lib_and_link() {
let src_dir = format!(
"{}",
PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap())
.join(LIB_NAME)
.join(LIB_NAME)
.join("src")
.display());
.join(LIB_NAME)
.join(LIB_NAME)
.join("src")
.display()
);

let includes_dir = vec![
src_dir.clone()
];
let includes_dir = vec![src_dir.clone()];

let lib_sources = include_str!("coinutils_lib_sources.txt")
.trim()
Expand All @@ -55,5 +63,4 @@ fn build_lib_and_link() {
config.files(lib_sources);

config.compile(LIB_NAME);

}

0 comments on commit 3029fc4

Please sign in to comment.