cocos2d / cocos2d-console

cocos2d command line tool
152 stars 190 forks source link

simplify selecting toolchain version #342

Closed minggo closed 8 years ago

sachingarg05 commented 8 years ago

It will be better to use clang toolchain instead of gcc. Google has deprecated GCC with NDK r11.

From http://developer.android.com/ndk/downloads/revision_history.html

Clang Important announcements We strongly recommend switching to Clang.

GCC Important announcements GCC in the NDK is now deprecated in favor of Clang.

We have also faced crashes with GCC toolchain when using lambda functions on x86 builds, and resolved it by updating cocos2dx build files to use clang toolchain (this was in a project still using cocos2dx v3.9).

Only need to change the build script to return 'clang' instead of '4.8' or '4.9'

But when changing the toolchain, it should ideally also be changed for the prebuilt libraries included in cocos2dx. I didn't edit that and it 'seems' to work fine at least for our project, but it can lead to unexpected crashes etc. All statically linked components must be built with same toolchain.

(As also mentioned in this thread: http://discuss.cocos2d-x.org/t/osx-android-ndk-uses-wrong-toolchain-version-due-to-missing-release-file/29014/15 )

minggo commented 8 years ago

@sachingarg05 thanks, i created https://github.com/cocos2d/cocos2d-x/issues/15577 for it.