mirror of
https://github.com/servo/servo.git
synced 2025-08-13 17:35:36 +01:00
Remove unnecessary sysroot and platform configuration from build script.
This commit is contained in:
parent
ac331c6663
commit
9d52fb88ab
1 changed files with 0 additions and 22 deletions
|
@ -24,36 +24,14 @@ fn android_main() {
|
||||||
env::var_os("ANDROID_NDK").expect("Please set the ANDROID_NDK environment variable");
|
env::var_os("ANDROID_NDK").expect("Please set the ANDROID_NDK environment variable");
|
||||||
let ndk_path = Path::new(&ndk_path);
|
let ndk_path = Path::new(&ndk_path);
|
||||||
|
|
||||||
let target = env::var("TARGET").unwrap();
|
|
||||||
let arch = if target.contains("arm") {
|
|
||||||
"arch-arm"
|
|
||||||
} else if target.contains("aarch64") {
|
|
||||||
"arch-arm64"
|
|
||||||
} else if target.contains("x86") || target.contains("i686") {
|
|
||||||
"arch-x86"
|
|
||||||
} else if target.contains("mips") {
|
|
||||||
"arch-mips"
|
|
||||||
} else {
|
|
||||||
panic!("Invalid target architecture {}", target);
|
|
||||||
};
|
|
||||||
|
|
||||||
let platform = if target.contains("aarch64") {
|
|
||||||
"android-21"
|
|
||||||
} else {
|
|
||||||
"android-18"
|
|
||||||
};
|
|
||||||
|
|
||||||
// compiling android_native_app_glue.c
|
// compiling android_native_app_glue.c
|
||||||
let c_file = ndk_path
|
let c_file = ndk_path
|
||||||
.join("sources")
|
.join("sources")
|
||||||
.join("android")
|
.join("android")
|
||||||
.join("native_app_glue")
|
.join("native_app_glue")
|
||||||
.join("android_native_app_glue.c");
|
.join("android_native_app_glue.c");
|
||||||
let sysroot = ndk_path.join("platforms").join(platform).join(arch);
|
|
||||||
cc::Build::new()
|
cc::Build::new()
|
||||||
.file(c_file)
|
.file(c_file)
|
||||||
.flag("--sysroot")
|
|
||||||
.flag(sysroot.to_str().unwrap())
|
|
||||||
.warnings(false)
|
.warnings(false)
|
||||||
.compile("android_native_app_glue");
|
.compile("android_native_app_glue");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue