servo: Merge #14528 - Add C++ runtime shared object to the Android APK (from mmatyas:android_cppruntime); r=larsbergstrom

<!-- Please describe your changes on the following line: -->
At the moment, the Android port requires `libc++_shared.so` to run -- this patch adds the file to the generated APK.

Part of #13154.

If you know a cleaner way to solve this issue, feel free to share it! Static linking didn't work, see the related issue.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 91a223093368be339ad00f42df4214ac36e1be6e
This commit is contained in:
Mátyás Mustoha 2016-12-13 13:35:25 -08:00
Родитель 3e46bb36c3
Коммит 80737dc897
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -17,7 +17,7 @@ fn main() {
let (args, passthrough) = parse_arguments();
// Find all the native shared libraries that exist in the target directory.
let native_shared_libs = find_native_libs(&args);
let mut native_shared_libs = find_native_libs(&args);
// Get the SDK path from the ANDROID_HOME env.
let sdk_path = env::var("ANDROID_HOME").ok().expect("Please set the ANDROID_HOME environment variable");
@ -32,6 +32,14 @@ fn main() {
.ok()
.expect("Please set the ANDROID_PLATFORM environment variable");
// Add the C++ runtime .so
{
let libcpp_base_path = ndk_path.join("sources").join("cxx-stl").join("llvm-libc++").join("libs");
let libcpp_filename = "libc++_shared.so";
let libcpp_path = libcpp_base_path.join("armeabi").join(libcpp_filename);
native_shared_libs.insert(libcpp_filename.to_string(), libcpp_path);
}
// Get the standalone NDK path from NDK_STANDALONE env.
// let standalone_path = env::var("NDK_STANDALONE").ok().unwrap_or("/opt/ndk_standalone".to_string());
// let standalone_path = Path::new(&standalone_path);