diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index f55fd280263b8c..f62ef73307b8d6 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -92,7 +92,14 @@ config("abi_default") { ] } } + ldflags = cflags + + if (current_os == "android") { + ldflags += [ + "-static-libstdc++", + ] + } } config("target_default") { diff --git a/src/android/CHIPTool/README.md b/src/android/CHIPTool/README.md index 55354826d6e0b1..2fa6a80711b2f0 100644 --- a/src/android/CHIPTool/README.md +++ b/src/android/CHIPTool/README.md @@ -58,14 +58,4 @@ rsync -a out/android_arm64/lib/jni/* src/android/CHIPTool/app/src/main/jniLibs ## JAR and .so libraries will be copy to target directories. ``` -6. You will also need the "libc++\_shared.so" file in the jniLibs folder. This - file comes packaged with Android NDK and can be found under - `$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++/libs/$TARGET`, e.g. - - `rsync -a "${ANDROID_NDK_HOME}/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so" src/android/CHIPTool/app/src/main/jniLibs/arm64-v8a/` - - (Eventually hoping to not have to include this .so, but that needs some more - tweaking of the Android automake build rules. Include it in the interim to - be able to build the Android app). - -7. 'Gradle sync' the Android project and run. +6. 'Gradle sync' the Android project and run.