Skip to content

Commit 9dc7f6c

Browse files
committed
update document
1 parent 7749a55 commit 9dc7f6c

File tree

1 file changed

+22
-58
lines changed

1 file changed

+22
-58
lines changed

README.md

Lines changed: 22 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ As an example, if you want to support cocos2d-x in ARM64, you need to compile al
1111

1212
- We use MacOSX to build all the static libraries for iOS, Android, Mac and Tizen.
1313

14-
- We use Windows to build all the static libraries for Win32.
14+
- We use Windows to build all the static libraries for Win32, WP8 and WinRT.
1515

1616
- We use Ubuntu to build all the static libraries for Linux.
1717

@@ -30,6 +30,7 @@ As an example, if you want to support cocos2d-x in ARM64, you need to compile al
3030
If you are a Homebrew user, you could simply run the following commands to install these tools:
3131

3232
```cpp
33+
brew update
3334
brew install git
3435
brew install cmake
3536
brew install m4
@@ -61,39 +62,32 @@ pacman -S libtool
6162
```
6263

6364
## How to use
64-
### For iOS Platform
65-
For building libpng fat library:
65+
We have one build script for each platform, they are under `build/platform{ios/mac/android/tizen}` directory.
6666

67-
```cpp
68-
cd build/ios
69-
./build_png.sh
67+
All of them share the same usage:
68+
69+
```
70+
./build.sh --libs=param1 --arch=param2 --mode=param3
7071
```
7172

72-
Or you can also use `build.sh` script build each static library for different arch.
73-
The usage would be:
73+
- param1:
74+
- use `all` to build all the 3rd party libraries, it will take you a very long time.
75+
- use comma separated library names, for example, `png,lua,jpeg/webp`, no space between the comma.
7476

75-
```cpp
76-
usage: $0 [-s] [-k sdk] [-a arch] [-l libname]
7777

78-
OPTIONS
79-
-k <sdk version> Specify which sdk to use ('xcodebuild -showsdks', current: 8.1)
80-
-s Build for simulator
81-
-a <arch> Specify which arch to use (current: armv7)
82-
-l <libname> Specify which static library to build
83-
```
78+
### For iOS Platform
8479

85-
If you want to build *websockets* with *i386* arch, you could use the following command:
80+
81+
For building libpng fat library:
8682

8783
```cpp
8884
cd build/ios
89-
./build.sh -s -a i386 -l websockets (Don't forget the -s option, it is stand for simulator, if you omit it, it will give you errors.)
85+
./build.sh --libs=png
9086
```
9187

92-
In this way, you can only build one arch a time, if you want to build a fat library, please use `build_xxx.sh` instead.(xxx is the library name, we will follow this conversion throughout this document.)
88+
This command will build a fat library with arch i386, x86_64, armv7 and arm64 on release mode.
9389

94-
If you use `build_xxx.sh` to build static libraries, all the generated `header files` and `.a files` are under the folder named as `xxx`.
95-
96-
Let's give png as an example, after you run `./build_png.sh`, it will generate a folder named `png`:
90+
After running this command, it will generate a folder named `png`:
9791

9892
The folder structure would be:
9993

@@ -106,44 +100,13 @@ The folder structure would be:
106100
All the other libraries share the same folder structure.
107101

108102
### For Android Platform
109-
For building libpng with armeabi, armeabi-v7a and x86 arch, you can do it like this:
110-
111-
```cpp
112-
cd build/android
113-
./build_png.sh
114-
```
115-
Or you can also use `build.sh` script build each static library for different arch.
116-
The usage would be:
117-
118-
```cpp
119-
-k <sdk> Use the specified Android API level (default: android-19)
120-
-a <arch> Use the specified arch (default: armeabi-v7a)
121-
-n <version> Use the gcc version(default: 4.8)
122-
-l <libname> Use the specified library name
123-
EOF
124-
```
125-
126-
If you want to build a `curl` library with `armeabi` arch support, you can do it like this:
127-
128-
```cpp
129-
cd build/android
130-
./build.sh -a armeabi -l curl
131-
```
103+
xxx document will be update later.
132104

133105
### For Mac
134-
For building libpng x86_64 arch library:
106+
xxx document will be update later.
135107

136-
```cpp
137-
cd build/mac
138-
./build_png.sh
139-
```
140108
### For Tizen
141-
For building libpng armv7 arch library:
142-
143-
```cpp
144-
cd build/tizen
145-
./build_png.sh
146-
```
109+
xxx document will be update later.
147110

148111
### For Linux
149112
xxx After testing these scripts on Linux, document will be update.
@@ -152,11 +115,12 @@ xxx After testing these scripts on Linux, document will be update.
152115
xxx we need to improve the script to add debug and release options.
153116

154117
## How to do build clean?
155-
If you use `./build_xxx.sh` to build static libraries, there is no need to do clean. After generating the static library, script will delete the intermediate files.
118+
If you use `./build.sh` to build static libraries, there is no need to do clean. After generating the static library, script will delete the intermediate files.
156119

157-
If you use `./build.sh` manually, you should delete the folders generated in src folder.
158120

159121
## How to upgrade a existing library
160122
If you find a 3rd party library has some critical bug fix, you might need to update it.
161123
You can following the [README](./contrib/src/README) file to do this job.
162124

125+
## How to add new 3rd party libraries
126+
Please refer to [README](./contrib/src/README)

0 commit comments

Comments
 (0)