|
1 | 1 | # Godot iOS plugins |
2 | 2 |
|
3 | 3 |
|
4 | | -## Building a `.a` library |
| 4 | +## Instructions |
| 5 | + |
| 6 | +* Clone this repository and it's submodules: |
| 7 | + ``` |
| 8 | + git clone --recurse-submodules https://github.com/godotengine/godot-ios-plugins |
| 9 | + ``` |
| 10 | + You might require to update `godot` submodule in case you require latest (unreleased) Godot changes. To do this run: |
| 11 | + ``` |
| 12 | + cd godot |
| 13 | + git fetch |
| 14 | + git checkout origin/<branch you want to use> |
| 15 | + ``` |
| 16 | + |
| 17 | +* Alternatively you can use pre-extracted Godot headers that will be provided with release tag at [Releases page](https://github.com/godotengine/godot-ios-plugins/releases). |
| 18 | + To do this clone this repo without submodules: |
| 19 | + ``` |
| 20 | + git clone https://github.com/godotengine/godot-ios-plugins |
| 21 | + ``` |
| 22 | + Then place extracted Godot headers in `godot` directory. |
| 23 | + If you choose this option you can skip next step to genarate of Godot headers. |
| 24 | + |
| 25 | +* To generate Godot headers you need to run compilation command inside `godot` submodule directory. |
| 26 | + Example: |
| 27 | + ``` |
| 28 | + scons platform=iphone target=debug |
| 29 | + ``` |
| 30 | + You don't have to wait for full engine compilation as header files are generated first, so once an actual compilation starts you can stop this command. |
| 31 | + |
| 32 | +* Running |
| 33 | + ``` |
| 34 | + scons target=<debug|release|release_debug> arch=<arch> simulator=<no|yes> plugin=<plugin_name> version=<3.2|4.0> |
| 35 | + ``` |
| 36 | + will generate `.a` static library for chosen target. |
| 37 | + Do note, that Godot's default `debug` export template is compiled with `release_debug` target. |
5 | 38 |
|
6 | | -* Use submodule to pull required Godot version into `godot` folder. (`master` branch for `4.0` and `3.2` branch for `3.2` version) |
7 | | - Alternatively you can place a Godot's header files including generated ones at `godot` folder. |
8 | | - You can extract headers from Godot's source manually or by using `extract_headers.sh` script from `scripts` folder. |
| 39 | +## Building a `.a` library |
9 | 40 |
|
10 | | -* Run `scons target=<debug|release|release_debug> arch=<arch> simulator=<no|yes> plugin=<plugin_name> version=<3.2|4.0>` to compile the plugin you need for specific version of Godot. |
11 | | - You can also use `./scripts/generate_xcframework.sh <plugin_name> <debug|release|release_debug> <godot_version>` to generate fat static library with specific configuration. |
| 41 | +* Run `./scripts/generate_static_library.sh <plugin_name> <debug|release|release_debug> <godot_version>` to generate `fat` static library with specific configuration. |
12 | 42 |
|
13 | 43 | * The result `.a` binary will be stored in `bin` folder. |
14 | 44 |
|
15 | 45 | ## Building a `.xcframework` library |
16 | 46 |
|
17 | | -* Use submodule to pull required Godot version into `godot` folder. (`master` branch for `4.0` and `3.2` branch for `3.2` version) |
18 | | - Alternatively you can place a Godot's header files including generated ones at `godot` folder. |
19 | | - You can extract headers from Godot's source manually or by using `extract_headers.sh` script from `scripts` folder. |
20 | | - |
21 | | -* Run `./scripts/generate_xcframework.sh <plugin_name> <debug|release|release_debug> <godot_version>` |
| 47 | +* Run `./scripts/generate_xcframework.sh <plugin_name> <debug|release|release_debug> <godot_version>` to generate `xcframework` with specific configuration. `xcframework` allows plugin to support both `arm64` device and `arm64` simulator. |
22 | 48 |
|
23 | 49 | * The result `.xcframework` will be stored in `bin` folder as well as intermidiate `.a` binaries. |
0 commit comments