Simplify Monero build script

This commit is contained in:
Luke Parker 2022-04-26 22:59:20 -04:00
parent 3c98e85c0a
commit 79f39c4433
No known key found for this signature in database
GPG key ID: F9F1386DB1E119B6

View file

@ -43,48 +43,24 @@ fn main() {
&env::consts::DLL_EXTENSION &env::consts::DLL_EXTENSION
) )
).exists() { ).exists() {
if !Command::new("cp").args(&[ for (folder, lib) in [
&format!( ("crypto", "cncrypto"),
"c/monero/src/crypto/{}cncrypto.{}", ("device", "device"),
&env::consts::DLL_PREFIX, ("ringct", "ringct_basic"),
&env::consts::DLL_EXTENSION ("ringct", "ringct")
), ] {
out_dir if !Command::new("cp").args(&[
]).status().unwrap().success() { &format!(
panic!("Failed to cp cncrypto"); "c/monero/src/{}/{}{}.{}",
} folder,
&env::consts::DLL_PREFIX,
if !Command::new("cp").args(&[ lib,
&format!( &env::consts::DLL_EXTENSION
"c/monero/src/device/{}device.{}", ),
&env::consts::DLL_PREFIX, out_dir
&env::consts::DLL_EXTENSION ]).status().unwrap().success() {
), panic!("Failed to cp {}", lib);
out_dir }
]).status().unwrap().success() {
panic!("Failed to cp device");
}
if !Command::new("cp").args(&[
&format!(
"c/monero/src/ringct/{}ringct_basic.{}",
&env::consts::DLL_PREFIX,
&env::consts::DLL_EXTENSION
),
out_dir
]).status().unwrap().success() {
panic!("Failed to cp ringct_basic");
}
if !Command::new("cp").args(&[
&format!(
"c/monero/src/ringct/{}ringct.{}",
&env::consts::DLL_PREFIX,
&env::consts::DLL_EXTENSION
),
out_dir
]).status().unwrap().success() {
panic!("Failed to cp ringct");
} }
println!("cargo:rerun-if-changed=c/wrapper.c"); println!("cargo:rerun-if-changed=c/wrapper.c");