mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #14528 - mmatyas:android_cppruntime, r=larsbergstrom
Add C++ runtime shared object to the Android APK <!-- 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. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14528) <!-- Reviewable:end -->
This commit is contained in:
commit
91a2230933
1 changed files with 9 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue