Building ONLY cocos2d-x libraries

Building ONLY cocos2d-x libraries
0.0 0


Hi all!
We want to develop a multiplatform game (Android & iPhone & Win32) using Cocos2d-x. Our first step will be the creation of a CMake script to generate all the build scripts for those platforms.
We have a simple test running on Win32, but we are experiencing some problems trying to generate build scripts for iPhone platform. The thing is that we need to build only cocos2d-x libraries (libCocosDenshion, libCocos2d, libChipmunk, etc), but ONLY the libraries. So we don’t want to run “install-templates-xcode” script, because we are generating the building scripts from CMake.
The problem is that we can’t see any xcode script to build just the libraries, as we can see on Win32 platform.

Any ideas?


The template of iOS only copy files to the directory used for XCode. If you want to build only cocos2d-x libraries, you can refer the article:

The article describes how to build libcurl in iOS. Hope this can help you.


I think I’m gonna try to make some CMake scripts, because I don’t like to put anybody else’s codes into my projects. Besides, in general is not a good idea. :slight_smile:


I dislike it too, every time build a ios project it will copy all cocos2dx sources in lib.
my linux port has eliminated this. but now it rely on eclipse to compile the lib and helloworld. I am considering to use cmake to build the linux lib in different distributes.


I just have finished some CMake scripts that generate build stuff for windows. I have tested them with VS2010, Win7_64 and cocos2d-1.0.1-x-0.9.1, and they work just fine.
The idea is to make them work for Android and iOS. The next platform I want to try is iOS, but I need a virtual machine of OSX first.
Any help with iOS or Android will be much appreciated!

I put attached a rar file with the scripts. You only have to unrar them in the directory where your cocos2d-x is.



Thanks Roberto. You can take a look at, laschweinski has written some CMake scripts for android & linux.


It seems they have recently deleted the CMake scripts.
Thanks anyway,


We have done this on iOS using XCODE and Workspace / Project scripts and some custom build shell scripts. Not too bad and working fine. cocos2d .a files are generated for the different configurations once and iOS projects builds link against them.

Now need to do this for Android…