37 lines
733 B
Rust
37 lines
733 B
Rust
|
#![allow(dead_code)]
|
||
|
|
||
|
fn dynamic_library(library_name: &str) {
|
||
|
println!("cargo:rustc-link-lib=dylib={}", library_name);
|
||
|
}
|
||
|
|
||
|
fn static_library(library_name: &str) {
|
||
|
println!("cargo:rustc-link-lib=static={}", library_name);
|
||
|
}
|
||
|
|
||
|
fn mac_framework_path(path: &str) {
|
||
|
println!("cargo:rustc-link-search=framework={}", path);
|
||
|
}
|
||
|
|
||
|
fn native_path(path: &str) {
|
||
|
println!("cargo:rustc-link-search=native={}", path);
|
||
|
}
|
||
|
|
||
|
#[cfg(target_os = "macos")]
|
||
|
fn set_compiler_flags() {
|
||
|
native_path("Gavania/lib/MacOS");
|
||
|
}
|
||
|
|
||
|
#[cfg(target_os = "windows")]
|
||
|
fn set_compiler_flags() {
|
||
|
native_path("lib/windows");
|
||
|
}
|
||
|
|
||
|
#[cfg(target_os = "linux")]
|
||
|
fn set_compiler_flags() {
|
||
|
native_path("lib/linux");
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
set_compiler_flags();
|
||
|
}
|