ndk-samples icon indicating copy to clipboard operation
ndk-samples copied to clipboard

A hello-jni++ project would be useful

Open noloader opened this issue 4 years ago • 1 comments

Hi Everyone,

I help manage a C++ library. The library supports Android. We are fairly strict about the flags we use for the project. When building on Android we want to ensure we always use the same flags as the Android project.

Ndk-samples provides a hello-jni project for C programs and libraries. We currently use ndk-build and hello-jni to obtain most of the flags we need to match Android flags. However, it is missing C++ specific flags the Android project might use, like -stdlib=libc++ and -std=c++11.

It would be very useful if ndk-samples provided a hello-jni++ project for C++ projects. A hello-jni++ would provide developers with the reference implementation and flags.

Thanks in advance.


Here are the steps we use to determine the C flags.

android$ git clone https://github.com/googlesamples/android-ndk
android$ cd android-ndk
android$ git checkout android-mk
android$ cd hello-jni

android:hello-jni$ ndk-build APP_PLATFORM=android-23 V=1
...

noloader avatar Feb 14 '21 14:02 noloader

Sounds like that you needs to port those building flags (including the default ones set by gradle and ndk-build tool), correct?

ggfan avatar Feb 17 '21 18:02 ggfan

As best as I can tell you're asking for https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md.

DanAlbert avatar May 03 '24 22:05 DanAlbert