-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathbuild.rs
27 lines (21 loc) · 862 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#[cfg(not(transaction))]
fn main() {}
#[cfg(transaction)]
fn main() {
use ::cmake::Config;
// dynamically link to standard c++ lib so we can call boost functions in mymonero-core-cpp
if cfg!(target_os = "macos") {
println!("cargo:rustc-link-lib=dylib=c++");
println!("cargo:rustc-link-lib=boost_thread-mt");
} else {
println!("cargo:rustc-link-lib=dylib=stdc++"); // Linux/GCC
println!("cargo:rustc-link-lib=boost_thread");
}
println!("cargo:rustc-link-lib=boost_system");
// build mymonero-core-cpp
let mymonero_path = Config::new("mymonero-core-cpp").build();
// let rustc know where mymonero-core-cpp is located
println!("cargo:rustc-link-search=native={}", mymonero_path.display());
// link mymonero-core-cpp library
println!("cargo:rustc-link-lib=mymonero-core-cpp");
}