This is a port of libBlocksRuntime to the Android NDK.
As of NDK-r8, Clang ships as an unsupported compiler. Using the -fblocks
compile flag and linking against this library fully enables Apple's blocks extension on Android.
Do not use configure or the Makefile; these are there in order to build for other supported platforms.
-
Add
libblocksruntime
to yourLOCAL_STATIC_LIBRARIES
. -
Add the directory with
blocks.h
to your include list viaLOCAL_CFLAGS
-
Specify clang as the compiler of choice, either in
Application.mk
or from the command line when building.NDK_TOOLCHAIN_VERSION="clang3.1" ndk-build