So I've been doing some cross-platform mobile applications using cocos2d-x. Basically it uses common c++ code, that can easily be compiled to the popular mobile platforms with some small wrapper code that stays constant while working on the common c++ code. Everything works great, but I have a problem keeping all my project files up to date. For example, to compile to windows I have a .csproj file that holds all the c++ code to compile, for iOS I have a .xcodeproj that holds the files, and for android I have a make file that points to the files to compile. This means any time I add a new file to my project, or do anything to alter the file structure I have 3 files I must update in order to continue to build for all platforms, if I add any other platforms the problem continues to get worse.

I am wondering, is this a problem that has been solved? I'm sure I'm not the first to have problems like this, keeping up multiple project / make files to update for the different platforms to compile. I was thinking of writing my own wrapper that can easily update these files without having to open an IDE / notepad to manually update any time I add a file. But before I do I thought I'd ask the question if there was a well accepted way to handle this problem, perhaps something that already exists that deals with this exact problem.

I was curious about whether to ask this here or stackoverflow, as I'm curious both at the cocos2d-x specific case, but also the general case whenever multiple projects must be updated whenever new code is added. I chose to post it here, but am interested to the answer to both questions (specifically if cocos2d-x has something already widely used to solve the problem, and solving the problem in the general case).

  • I know it isn't a good point to suggest this, but have you asked the main cocos2d devs or searched their forums for a similar issue? It most likely has come up (and I would think a solution should already exist within cocos2d). However, your solution of making a wrapper is probably the simplest way of doing it. The wrapper should act as a file tracker and do the checks before compiling (or whenever suits you best to check). You could also probably package your wrapper and share the code with the cocos2d folks. You will be thanked a lot if such a solution doesn't exist yet (highly unlikely). – Joe Sep 23 '14 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.