summarylogtreecommitdiffstats
path: root/README
blob: 4121a012bd06ee58b1fa9369b53bcc897c8dc2bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Very important point to have a full functionnal cocos2d-x install:

*******************
**    WARNING    **
*******************
 * All cocos2d scripts use python2. Calling "python2 script" is not enough
   as other submodule will be called with "env python" (which could point to python3).
   cocos2d scripts will failed if called with python3.

   In order to use cocos2d wrapper correctly without forcing symlink python to be python2,
   you can use this : https://wiki.archlinux.org/index.php/python#Dealing_with_version_problem_in_build_scripts
   A first pattern I suggest is "/opt/cocos2d-x/*"


************************
**    CONFIGURATION   **
************************
 * In order to use android, you should define in your bashrc, zshrc, whateverrc :
export NDK_ROOT=/opt/android-ndk
export ANDROID_SDK_ROOT=/opt/android-sdk
export ANT_ROOT=/usr/bin
   (Each path came with package aur/android-ndk aur/android-sdk and extra/apache-ant)


 * Use "cocos" wrapper to create, compile, run your project...
   "cocos" will echo you basic command
   "cocos command" will echo you basic parameter for "command"

   Basic setup :
   cocos new -l cpp -p com.firm.app myapp
   cd myapp
   cocos run -p android -j3
   cocos run -p linux -j3

   Alternative 1 :
   cocos new -l cpp -p com.firm.app myapp
   mkdir linux-build && cd linux-build
   cmake ..
   ../bin/debug/linux/MyGame

   Alternative 2 (howewer compile failed near 70% on unfound malloc/free):
   export CC=/usr/bin/clang
   export CXX=/usr/bin/clang++
   cocos new -l cpp -p com.firm.app myapp
   mkdir linux-build && cd linux-build
   cmake -G Ninja -DCLANG=ON ..
   ../bin/debug/linux/MyGame
   

 * Personnal preference :
   You can edit myapp/CMakeLists.txt to adjust personnal preference
   (and speed up compile time, avoiding unnecessary things)
   Here my personnal customisation :
set(DEBUG_MODE OFF CACHE BOOL                "Debug or release? Release!")
set(BUILD_EXTENSIONS OFF CACHE BOOL          "Turn off build extension library")
set(BUILD_EDITOR_SPINE OFF CACHE BOOL        "Turn off build editor support for spine")
set(BUILD_EDITOR_COCOSTUDIO OFF CACHE BOOL   "Turn off build editor support for cocostudio")
set(BUILD_EDITOR_COCOSBUILDER OFF CACHE BOOL "Turn off build editor support for cocosbuilder")
set(BUILD_CPP_TESTS OFF CACHE BOOL           "Turn off build TestCpp samples")
set(BUILD_LUA_LIBS OFF CACHE BOOL            "Turn off build lua libraries")
set(BUILD_LUA_TESTS OFF CACHE BOOL           "Turn off build TestLua samples")

I think that's all for the moment.
I hope you'll enjoy as mush as I am !