Question

I'm trying to use GYP for generating iOS/OS X Xcode project and Makefile(or Android.mk) for Android NDK on OS X. Generating Xcode project is awesome, no problem at all. But for Android, I don't know exactly how to do that.

TOOLCHAIN=/usr/local/Cellar/android-ndk/r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86/bin/arm-linux-androideabi \
CC=$TOOLCHAIN-gcc \
CXX=$TOOLCHAIN-g++ \
LINK=$TOOLCHAIN-g++ \
AR=$TOOLCHAIN-ar \
gyp project.gyp --depth=. -f make -DOS=android -Gandroid_ndk_version=r9d

Generated makefile has some problem. For example, AR.target doesn't point Android toolchain, CFLAGS and LDFLAGS has "-arch x86_64". However generated project.target.mk seems to have lines, just like Android.mk, which is intended for Android NDK. I think I need just these part of generated makefiles.

How can I generate Makefile or Android.mk on OS X using GYP?

Was it helpful?

Solution

I found a complete GYP example for Android NDK!

It works well even though on OS X.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top