Hi,
Cocos team - thank you for “cosos gen-libs”.
There is good documentation http://www.cocos2d-x.org/wiki/Cocos_gen-libs how to generate prebuild library. But missing is very important part: how to use it
Below my steps how to setup prebuild “cosos gen-libs” for win32. Could you send me steps for Android on Windows? I read all 58 posts of How to speed up cocos2d-x build with prebuilt lib but still failed on Android …
My Working folder g:\gen-libs-test. Checked on: cocos2d-x-3.8.1.zip, Windows 10, VS 2015 Community
- download and unzip cocos2dx source to g:\gen-libs-test\cocos2d
- Create test project
cocos new -l cpp test - remove cocos2d folder from test project
rmdir /S /Q test\cocos2d - Build cocos gen-libs
cocos gen-libs -p win32 --vs 2015 -m debug - fix incorrect output files
cd cocos2d\prebuilt\win32
copy libcocos2d_2015.dll libcocos2d.dll
copy libcocos2d_2015.lib libcocos2d.lib
copy libbox2d_2015.lib libbox2d.lib
copy libSpine_2015.lib libSpine.lib
cd g:\gen-libs-test - Update *.sln, *.vcproj to prebuild folder. (It can be done also from UI) Below git diff in attached
git_diff.zip (2.2 KB) - Open VS solution Double click g:\gen-libs-test\test\proj.win32\test.sln
- Run i.e. in debugger - F5 (only AppDelegate.cpp HelloWorldScene.cpp main.cpp should be compiled)
Below “cocos gen-libs” issues:
- Output files generated with postfix “_2015.lib” are incorrect - I think should be without _2015
- Debug overwrites release (the same issue exist for other platforms)
i.e.
cocos gen-libs -p win32 --vs 2015 -m debug
release output dir is the same as release
cocos gen-libs -p win32 --vs 2015 -m release
I think that cpp-template-prebuild could be very useful for prebuild. And next we can just call “cocos new -l cpp -t cpp-template-prebuild test”
Regards,
B