I am working on the CMake build system for cocos2d-x, this is some introduction about what have done and what need to be done.
Our final target is CMake support all platforms and could generate Xcode and VS project. This is the pieces of our final target and the process below.
|Linux||Done||Once, Ubuntu 16.04|
|Android||Done||Once, Need Further||18154 18646 300|
|macOS||Done||Twice, Need Further||18646|
|iOS||Done||Once, using iOS Simulator||18646|
|Windows||Done||Once, only msvc||18683|
|Xcode||Done||Once, using Xcode 9.2||18646|
|VS||Done||Once, using VS2017 on Win10||18683|
|Prebuilt Support||Done||Test once in every platform above||18683|
Target is the CMake build aim for every one platform, Develop is used to describe the develop process, and the Test stand for test process, I think we can’t merge it into main branch if we didn’t have full test.
As we all known, the build system of cocos2d-x is quite different on different platform, CMake build for linux, Xcode project for macOS, VS project for Windows, and ndk Build for Android Native. It’s complex to maintain, and not friendly to use for cross-platform developers
The official team only keep the CMake build on linux, meanwhile many developers push it support other platforms from time to time, recently developer newnon does a lot of works to push it support Android. see PR V3 android cmake support #18154 and Android cmake build support #300
Following the method of newnon, the CMake support for Android Native Build is almost done, and some build error on macOS have been fixed, see PR [in-progress] V3 android cmake support, add mac support
Done for every platforms, but still need improvement
In a word, works on the targets one by one. I will update the targets table when one of the targets is finished, and I hope you join in this great work, do some works marked To Do, or do further test, that is meaningful.
introduce the realization of CMake now, some important CMake files and Moduals
|CMake File Directory||Meanings|
|root/||build Cocos2d-x project include all engine library and all tests|
|root/cocos/||build engine core library, build js/lua library if needed|
|test project/||build test project and engine library needed|
|template project/||build the project of
|CocosBuildSet||the common part of every project need, such as set cmake_policy|
|SelectModule||set the default behavior of build module, many opitions|
|SetCompilerOptions||set compiler options depend on different platform and opitions|
root in the CMake File Directory stand for the cocos2d-x engine directory