axmolengine / axmol

Axmol Engine – A Multi-platform Engine for Desktop, XBOX (UWP) and Mobile games. (A fork of Cocos2d-x-4.0)
https://axmol.dev
MIT License
923 stars 205 forks source link

[Windows workflow] Compile engine once, link prebuilt for project #564

Closed halx99 closed 2 years ago

halx99 commented 2 years ago

Build engine once, linking by every projects

Use steps:

  1. Build engine firstly
cd axmol
cmake -B build_x86 -A Win32 -DAX_BUILD_TESTS=OFF
cmake --build build_x86 --config Debug
cmake --build build_x86 --config Release
  1. create new project and build with engine prebuilt libs
axmol new -p org.axmol.hellocpp -d D:\dev\projects\ -l cpp --portrait HelloCpp
cd /d D:\dev\projects\HelloCpp
cmake -B build_x86 -A Win32 "-DAX_PREBUILT_DIR=build_x86"
cmake --build build_x86 --config Debug --target HelloCpp
REM run the HelloCpp.exe
run.bat

Notes:

The app build architecture must match with axmol engine build dir

halx99 commented 2 years ago

Maybe add a CMakeOptions.md is better, there a other unified options needs docs, see relative issue: https://github.com/adxeproject/adxe/issues/578

aismann commented 2 years ago

Maybe add a CMakeOptions.md is better, there a other unified options needs docs, see relative issue: #578

Good idea. Only a link to this CMakeOptions.md on readme or wiki is usefull. What are you mean?