4.60 GB (4,940,689,408 bytes) TO 82.4 MB (86,466,560 bytes). !!
This is problem which bean around few years now and caused low disk space. and long compilation time.
Also the windows prebuild option in cocos doesn't work for me .
The simple principle here is that we will compile the cocos2d-x Libraries once.
And this will be Our central repository of lib's and dll's .
And our game EXE will compile and run localy in the project directory.
For simplicity im doing it only for DEBUG version .
- First we need to build the Coccos2d-x libereris , they need to created in some central place
So my defualt project is of course the cocos2d-win32.sln which compiles also the cpp-tests
so compile the Engine .
- When done , create the game project i call it test1 and i will create it in Projects directory
which is created in the Cocos2d-x root directory :
Using the cocos console command :
D:\dev\cpp\2d\cocos2d-x-3.10\Projects>cocos new -l cpp test1
- First thing is delete the test1 cocos2d huge directory .
- Then open the visual studio test1.vcxproj.user and test1.vcxproj
in your favorite text editor
which Located in :
- In test1.vcxproj.user we going to change the tags :
so it will look like this :
what this means ?
the PATH is aimed to the Debug output of the :
project form section 1.
The full test1.vcxproj.user look like this :
- In test1.vcxproj more stuff needs to be changes:
They all pointing to the main cocos2d-x engine :
Line 41: pointing to : "..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2dx.props"
Line 42: pointing to : "..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2d_headers.props"
Line 47: pointing to : "..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2dx.props"
Line 48: pointing to : "..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2d_headers.props"
Line 48: pointing to : "libcocos2d.lib;librecast.lib;libbullet.lib;"
Line 89: pointing to : "..\..\..\..\cocos2d-x-3.10\build\Debug.win32\"
Line 89: pointing to : "..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2d_headers.props"
The full test1.vcxproj look like this :
- Now we are ready to load the test1.sln to Visual Studio c++ in my case 2013
Once loaded , delete all other projects except our test1 .
- Compile the project and hit F5 to run it and walla !
The project running !
Size on disk : 82.4 MB (86,466,560 bytes).
1 .Now all is left to do is to automate this process to python script .
2. Cross platform.