4

I am using Android studio 1.5.1 with NDK Revision 11 that declared that GCC in the NDK is now deprecated in favor of Clang.

I need to switch between clang and gcc and customize flags, However, the application's configuration and the method of using Android.mk and Application.mk to switch between them seems to be changed!

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Hex
  • 145
  • 1
  • 2
  • 12

2 Answers2

6

I just changed the line in Application.mk from

NDK_TOOLCHAIN_VERSION := 4.9

to

NDK_TOOLCHAIN_VERSION := clang

and everything worked fine for me.

Karu
  • 4,512
  • 4
  • 30
  • 31
2

You can change your environment variable $CC to one that point to clang binary or you can use the script from $NDK_HOME/build/tools/make-standalone-toolchain.sh

You can run this script with the --help param to view all valid options.

References:

http://developer.android.com/intl/es/ndk/guides/standalone_toolchain.html

newhouse
  • 946
  • 8
  • 12