mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Android cross-compiled command line hello world
`cargo run` Just Works®
This commit is contained in:
parent
4cbf3dea05
commit
eab971cba1
8 changed files with 37 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,6 +4,7 @@
|
|||
/.servobuild
|
||||
/android-toolchains
|
||||
/target
|
||||
/support/android/egl-configs/target
|
||||
/ports/android/bin
|
||||
/ports/android/libs
|
||||
/ports/android/local.properties
|
||||
|
|
|
@ -7,7 +7,7 @@ default-members = [
|
|||
"ports/servo",
|
||||
"tests/unit/*",
|
||||
]
|
||||
exclude = [".cargo"]
|
||||
exclude = [".cargo", "support/android/egl-configs"]
|
||||
|
||||
[profile.release]
|
||||
opt-level = 3
|
||||
|
|
6
support/android/egl-configs/.cargo/config
Normal file
6
support/android/egl-configs/.cargo/config
Normal file
|
@ -0,0 +1,6 @@
|
|||
[build]
|
||||
target = "armv7-linux-androideabi"
|
||||
|
||||
[target.armv7-linux-androideabi]
|
||||
linker = "./ld.sh"
|
||||
runner = "./run.sh"
|
4
support/android/egl-configs/Cargo.lock
generated
Normal file
4
support/android/egl-configs/Cargo.lock
generated
Normal file
|
@ -0,0 +1,4 @@
|
|||
[[package]]
|
||||
name = "egl-configs"
|
||||
version = "0.1.0"
|
||||
|
3
support/android/egl-configs/Cargo.toml
Normal file
3
support/android/egl-configs/Cargo.toml
Normal file
|
@ -0,0 +1,3 @@
|
|||
[package]
|
||||
name = "egl-configs"
|
||||
version = "0.1.0"
|
6
support/android/egl-configs/ld.sh
Executable file
6
support/android/egl-configs/ld.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
NDK=../../../android-toolchains/android-ndk-r12b-linux-x86_64/android-ndk-r12b
|
||||
|
||||
"${NDK}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc" \
|
||||
--sysroot "${NDK}/platforms/android-18/arch-arm" \
|
||||
"$@"
|
10
support/android/egl-configs/run.sh
Executable file
10
support/android/egl-configs/run.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
path="$1"
|
||||
base="$(basename $1)"
|
||||
remote_path="/data/local/tmp/$base"
|
||||
shift
|
||||
|
||||
adb -e wait-for-device
|
||||
adb -e push "$path" "$remote_path"
|
||||
adb -e shell "$remote_path" "$@"
|
6
support/android/egl-configs/src/main.rs
Normal file
6
support/android/egl-configs/src/main.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
for arg in std::env::args() {
|
||||
println!("{}", arg);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue