chrigu
chrigu

Reputation: 3

Cocos2D-x Android: speeding up cpp compile process?

I am relatively new to Cocos2d-x and I am trying to build a project targeting iOS & Android devices. Building the Cpp project with Xcode (for iOS) is pretty fast but for Android you have to first compile the whole project with NDK which always recompiles the whole cocos2d framework and this takes up to 2 minutes for every single change I'd like to test on a device.

Can I somehow configure my build_native.sh or Android.mk file to use the compiled cocos2d framework and just compile my files in the Classes folder? I am working with version cocos2d-2.1beta3-x-2.1.0

Upvotes: 0

Views: 2316

Answers (1)

user1169079
user1169079

Reputation: 3083

Put this settings in Eclipse-> Project->Properties -> C/C++ Build

Uncheck the Use default build command

Build Command: bash ${workspace_loc:/XYZProjName}/build_native.sh NDK_DEBUG=1 V=1

Makefile generation should be disabled....

Build directory: ${workspace_loc:/XYZProjName}

Now just Build Project it will recompile your projects file only ...Whenever you clean and build it rebuilds the cocos2d-x framwork also which happens to be same in Xcode as far as my knowledge says ...

Whenever you change something in cocos2d-x classes then you neeed to do that clean (which means you are recompiling libgame.so) again which happens to be in the folder proj.android/obj/local/armeabi/ .... here at the location all your library which you are supposed to be using gets compile ..when you clean these all libraries get recompile ..

Hope you understand the concept ..If not ..Feel free to ask I will try to explain more ..

Upvotes: 2

Related Questions