mirror of https://github.com/axmolengine/axmol.git
edee97278f
* CMake build improvements * android cmake support * Enable proguard for cocos2d * examples & test cmake support * add android build type param to gradle.properties file * less warnings * update all android configs to recomended settings * fix network cmake error * fix js-tests cmake error * android build config, add cmake * android build config, add cmake * add lua share lib * android lua cmake build fix * fix * luajit test * run fail, still * fix js-warning * correct lua main include * lua test project cmake support android * try to add lua-template cmake support * lua template fix * js_tests support cmake on android * js-tests improve * cmake support js-template * test to realise prebuild * cmake improve, no feature * improve templates cmake * refactor cmake struct * correct cpp-tests cmake * cpp-templates cmake improve * typo fix * cmake struct refator * change default option * adapt new project struct * uniform cmake test style * add_dependencies to support make -j * little struct improve * little fix * adapt cmake bin dir * little improve about cmake version * change build all tests condition * add source_group for Xcode * add mark source files * add more mark source code * add template project to test * add macos info.plist template * add pak macos for all project * lua test icon fix * not consider lua project for now * modify pak method * add another ios toolchain * add ios system library * update ios toolchain, and reduce ios compile errors * reduce error * make ios engine lib compile pass * cpp-empty-test ios bundle * cpp-tests ios support * js-tests ios support * templates project support ios * fix the way of lua-tests package * try to fix lua-template on macOS * comment lua-template sim file * improve display on xcode * update cmake readme * check android compile again * fix android compile error * fix linux cmake res error * update deps version, for cmake * fix lua_template linux compile error * close android cmake support for now * review template android share library name * change PROP_BUILD_TOOLS_VERSION version to 27.0.1 * change android compile version * make `PROP_APP_PLATFORM` back, add comments for android native build * Revert "make `PROP_APP_PLATFORM` back, add comments for android native build" This reverts commit 272ddc19886891b9502cde070753a870c0fdb588. |
||
---|---|---|
.. | ||
Modules | ||
AndroidNdkGdb.cmake | ||
AndroidNdkModules.cmake | ||
BuildHelpers.CMakeLists.txt | ||
README.md | ||
android.toolchain.cmake | ||
ios.toolchain.cmake |
README.md
CMake Build Instructions
Depending on your host system your Generator flag -G may be different
Typical -G options For using gcc and clang from a makefile
msys2 = "MSYS Makefiles" windows = "MinGW Makefiles" nix and mac = "Unix Makefiles"
For using and editor such as Visual Studio or xcode there are different flags
To like all available flags for your system run
cmake --help
Build Examples
using CMake in macOS terminal
cmake -H$COCOS_TEMPLATES_ROOT/.. -Bbuild_cocos2dx
cd build_cocos2dx
make all -j 4
Generate Xcode Project for macOS platform
cmake -H$COCOS_TEMPLATES_ROOT/.. -Bbuild_mac -GXcode
cd build_mac
open Cocos2d-x.xcodeproj
Generate Xcode Project for iOS platform
cd any_dir_you_want
cmake -DCMAKE_TOOLCHAIN_FILE=$COCOS_TEMPLATES_ROOT/../cmake/ios.toolchain.cmake -DIOS_PLATFORM=SIMULATOR64 -H$COCOS_TEMPLATES_ROOT/.. -Bbuild_ios_sim64 -GXcode
cd build_ios_sim64
open Cocos2d-x.xcodeproj
using CMake in Android Studio
see the Gradle properties: PROP_NDK_MODE
, it control the way of build Native
# android cmake support
# uncomment it, native code will build by cmake
# keep comment, native code will build by ndkBuild
# PROP_NDK_MODE=cmake
TODO
1. make cmake build support windows
2. generate Visual Studio project
3. test cmake build again on Linux
4. add examples and more details in this manual