mirror of
https://github.com/fathyb/carbonyl.git
synced 2025-01-07 03:07:10 +08:00
parent
8ade7be67a
commit
ab80a276b1
44
build.rs
Normal file
44
build.rs
Normal file
@ -0,0 +1,44 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
fn link_sysroot() {
|
||||
let sysroot_path = PathBuf::from("./chromium/src/build/linux/debian_bullseye_amd64-sysroot");
|
||||
|
||||
if sysroot_path.is_dir() {
|
||||
println!("cargo:rustc-link-search=chromium/src/build/linux/debian_bullseye_amd64-sysroot/lib/x86_64-linux-gnu");
|
||||
println!("cargo:rustc-link-search=chromium/src/build/linux/debian_bullseye_amd64-sysroot/usr/lib/x86_64-linux-gnu");
|
||||
|
||||
println!(
|
||||
"cargo:rustc-link-arg=--sysroot=./chromium/src/build/linux/debian_bullseye_amd64-sysroot"
|
||||
);
|
||||
} else {
|
||||
println!("cargo:warning={}", "x86_64 debian sysroot provided by chromium was not found!");
|
||||
println!("cargo:warning={}", "carbonyl may fail to link against a proper libc!");
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86")]
|
||||
fn link_sysroot() {
|
||||
let sysroot_path = PathBuf::from("./chromium/src/build/linux/debian_bullseye_i386-sysroot");
|
||||
|
||||
if sysroot_path.is_dir() {
|
||||
println!("cargo:rustc-link-search=chromium/src/build/linux/debian_bullseye_i386-sysroot/lib/i386-linux-gnu");
|
||||
println!("cargo:rustc-link-search=chromium/src/build/linux/debian_bullseye_i386-sysroot/usr/lib/i386-linux-gnu");
|
||||
|
||||
println!(
|
||||
"cargo:rustc-link-arg=--sysroot=./chromium/src/build/linux/debian_bullseye_i386-sysroot"
|
||||
);
|
||||
} else {
|
||||
println!("cargo:warning={}", "x86 debian sysroot provided by chromium was not found!");
|
||||
println!("cargo:warning={}", "carbonyl may fail to link against a proper libc!");
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
|
||||
fn link_sysroot() {
|
||||
// Intentionally left blank.
|
||||
}
|
||||
|
||||
fn main() {
|
||||
link_sysroot();
|
||||
}
|
Loading…
Reference in New Issue
Block a user