mirror of
https://github.com/openharmony/third_party_rust_libloading.git
synced 2026-07-21 00:26:36 -04:00
Make build.rs exhaustive
This commit is contained in:
@@ -1,19 +1,24 @@
|
||||
extern crate target_build_utils;
|
||||
use target_build_utils::TargetInfo;
|
||||
use std::io::Write;
|
||||
|
||||
fn main(){
|
||||
let target = TargetInfo::new().expect("could not get target info");
|
||||
match target.target_os() {
|
||||
"linux" | "android" => println!("cargo:rustc-link-lib=dl"),
|
||||
"freebsd" | "dragonfly" => println!("cargo:rustc-link-lib=c"),
|
||||
|
||||
// netbsd claims dl* will be available to any dynamically linked binary, but I haven’t
|
||||
// found any libraries that have to be linked to on other platforms.
|
||||
// "openbsd" | "bitrig" | "netbsd" | "macos" | "ios" => {}
|
||||
//
|
||||
// What happens if the executable is not linked up dynamically?
|
||||
"openbsd" | "bitrig" | "netbsd" | "macos" | "ios" => {}
|
||||
// dependencies come with winapi
|
||||
// "windows" => {}
|
||||
_ => {}
|
||||
"windows" => {}
|
||||
tos => {
|
||||
writeln!(::std::io::stderr(),
|
||||
"Building for an unknown target_os=`{}`!\nPlease report an issue ",
|
||||
tos).expect("could not report the error");
|
||||
::std::process::exit(0xfc);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user