-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
150 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,49 @@ | ||
# Godot iOS plugins | ||
|
||
|
||
## Building a `.a` library | ||
## Instructions | ||
|
||
* Clone this repository and it's submodules: | ||
``` | ||
git clone --recurse-submodules https://github.com/godotengine/godot-ios-plugins | ||
``` | ||
You might require to update `godot` submodule in case you require latest (unreleased) Godot changes. To do this run: | ||
``` | ||
cd godot | ||
git fetch | ||
git checkout origin/<branch you want to use> | ||
``` | ||
|
||
* 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). | ||
To do this clone this repo without submodules: | ||
``` | ||
git clone https://github.com/godotengine/godot-ios-plugins | ||
``` | ||
Then place extracted Godot headers in `godot` directory. | ||
If you choose this option you can skip next step to genarate of Godot headers. | ||
|
||
* To generate Godot headers you need to run compilation command inside `godot` submodule directory. | ||
Example: | ||
``` | ||
scons platform=iphone target=debug | ||
``` | ||
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. | ||
|
||
* Running | ||
``` | ||
scons target=<debug|release|release_debug> arch=<arch> simulator=<no|yes> plugin=<plugin_name> version=<3.2|4.0> | ||
``` | ||
will generate `.a` static library for chosen target. | ||
Do note, that Godot's default `debug` export template is compiled with `release_debug` target. | ||
|
||
* Use submodule to pull required Godot version into `godot` folder. (`master` branch for `4.0` and `3.2` branch for `3.2` version) | ||
Alternatively you can place a Godot's header files including generated ones at `godot` folder. | ||
You can extract headers from Godot's source manually or by using `extract_headers.sh` script from `scripts` folder. | ||
## Building a `.a` library | ||
|
||
* 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. | ||
You can also use `./scripts/generate_xcframework.sh <plugin_name> <debug|release|release_debug> <godot_version>` to generate fat static library with specific configuration. | ||
* Run `./scripts/generate_static_library.sh <plugin_name> <debug|release|release_debug> <godot_version>` to generate `fat` static library with specific configuration. | ||
|
||
* The result `.a` binary will be stored in `bin` folder. | ||
|
||
## Building a `.xcframework` library | ||
|
||
* Use submodule to pull required Godot version into `godot` folder. (`master` branch for `4.0` and `3.2` branch for `3.2` version) | ||
Alternatively you can place a Godot's header files including generated ones at `godot` folder. | ||
You can extract headers from Godot's source manually or by using `extract_headers.sh` script from `scripts` folder. | ||
|
||
* Run `./scripts/generate_xcframework.sh <plugin_name> <debug|release|release_debug> <godot_version>` | ||
* 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. | ||
|
||
* The result `.xcframework` will be stored in `bin` folder as well as intermidiate `.a` binaries. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
# Compile GameCenter | ||
|
||
./scripts/generate_static_library.sh gamecenter release $1 | ||
./scripts/generate_static_library.sh gamecenter release_debug $1 | ||
mv ./bin/gamecenter.release_debug.a ./bin/gamecenter.debug.a | ||
|
||
# Compile InAppStore | ||
|
||
./scripts/generate_static_library.sh inappstore release $1 | ||
./scripts/generate_static_library.sh inappstore release_debug $1 | ||
mv ./bin/inappstore.release_debug.a ./bin/inappstore.debug.a | ||
|
||
# Compile iCloud | ||
|
||
./scripts/generate_static_library.sh icloud release $1 | ||
./scripts/generate_static_library.sh icloud release_debug $1 | ||
mv ./bin/icloud.release_debug.a ./bin/icloud.debug.a | ||
|
||
# Compile Camera | ||
|
||
./scripts/generate_static_library.sh camera release $1 | ||
./scripts/generate_static_library.sh camera release_debug $1 | ||
mv ./bin/camera.release_debug.a ./bin/camera.debug.a | ||
|
||
# Compile ARKit | ||
|
||
./scripts/generate_static_library.sh arkit release $1 | ||
./scripts/generate_static_library.sh arkit release_debug $1 | ||
mv ./bin/arkit.release_debug.a ./bin/arkit.debug.a | ||
|
||
# Move to release folder | ||
|
||
rm -rf ./bin/release | ||
mkdir ./bin/release | ||
|
||
# Move GameCenter | ||
mkdir ./bin/release/gamecenter | ||
mv ./bin/gamecenter.{release,debug}.a ./bin/release/gamecenter | ||
|
||
# Move InAppStore | ||
mkdir ./bin/release/inappstore | ||
mv ./bin/inappstore.{release,debug}.a ./bin/release/inappstore | ||
|
||
# Move InAppStore | ||
mkdir ./bin/release/icloud | ||
mv ./bin/icloud.{release,debug}.a ./bin/release/icloud | ||
|
||
# Move Camera | ||
mkdir ./bin/release/camera | ||
mv ./bin/camera.{release,debug}.a ./bin/release/camera | ||
|
||
# Move ARKit | ||
mkdir ./bin/release/arkit | ||
mv ./bin/arkit.{release,debug}.a ./bin/release/arkit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
# Compile GameCenter | ||
|
||
./scripts/generate_xcframework.sh gamecenter release $1 | ||
./scripts/generate_xcframework.sh gamecenter release_debug $1 | ||
mv ./bin/gamecenter.release_debug.xcframework ./bin/gamecenter.debug.xcframework | ||
|
||
# Compile InAppStore | ||
|
||
./scripts/generate_xcframework.sh inappstore release $1 | ||
./scripts/generate_xcframework.sh inappstore release_debug $1 | ||
mv ./bin/inappstore.release_debug.xcframework ./bin/inappstore.debug.xcframework | ||
|
||
# Compile iCloud | ||
|
||
./scripts/generate_xcframework.sh icloud release $1 | ||
./scripts/generate_xcframework.sh icloud release_debug $1 | ||
mv ./bin/icloud.release_debug.xcframework ./bin/icloud.debug.xcframework | ||
|
||
# Compile Camera | ||
|
||
./scripts/generate_xcframework.sh camera release $1 | ||
./scripts/generate_xcframework.sh camera release_debug $1 | ||
mv ./bin/camera.release_debug.xcframework ./bin/camera.debug.xcframework | ||
|
||
# Compile ARKit | ||
|
||
./scripts/generate_xcframework.sh arkit release $1 | ||
./scripts/generate_xcframework.sh arkit release_debug $1 | ||
mv ./bin/arkit.release_debug.xcframework ./bin/arkit.debug.xcframework | ||
|
||
# Move to release folder | ||
|
||
rm -rf ./bin/release | ||
mkdir ./bin/release | ||
|
||
# Move GameCenter | ||
mkdir ./bin/release/gamecenter | ||
mv ./bin/gamecenter.{release,debug}.xcframework ./bin/release/gamecenter | ||
|
||
# Move InAppStore | ||
mkdir ./bin/release/icloud | ||
mv ./bin/icloud.{release,debug}.xcframework ./bin/release/icloud | ||
|
||
# Move InAppStore | ||
mkdir ./bin/release/inappstore | ||
mv ./bin/inappstore.{release,debug}.xcframework ./bin/release/inappstore | ||
|
||
# Move Camera | ||
mkdir ./bin/release/camera | ||
mv ./bin/camera.{release,debug}.xcframework ./bin/release/camera | ||
|
||
# Move ARKit | ||
mkdir ./bin/release/arkit | ||
mv ./bin/arkit.{release,debug}.xcframework ./bin/release/arkit |