Saturday, December 22, 2012

Android NDK now includes clang with Objective-C support

Apparently, the Android NDK started including clang in ndk-r8c. The Google folk had always disabled Objective-C from their gcc ports, making Objective-C support that much more difficult to achieve, but I had a hunch that disabling Objective-C from clang may well have been more effort than it's worth.

I just tried it with a vanilla, freshly downloaded ndk-r8d and a small Objective-C program compiled without problems, so it looks like my hunch was correct.

Of course, it didn't link because there is no runtime, but providing one is a much smaller effort than reconfiguring the entire toolchain. After that, it gets interesting...

Update: after getting a runtime, it linked and ran on my Galaxy II test phone.

4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Wow, cool!
    In which folder located the Objc headers?
    I want to try too.

    ReplyDelete
  3. Can you explain how to build *.m files?
    I'm new for Android NDK. I know, I should change something in ndk or rebuild comliler for supporting .m files

    result of simple building:
    "Android NDK: WARNING: Unsupported source file extensions in /Work/hello-gl2/jni/Android.mk for module gl2jni
    Android NDK: gl_code.m"

    Any help is appreciated!
    Many Thanks!

    ReplyDelete
  4. Which runtime? Do you plan to share a step by step tutorial? :)

    ReplyDelete