Skip to content

Commit

Permalink
Unify bits, android_arch, macos_arch ios_arch into arch, support non-x86
Browse files Browse the repository at this point in the history
Unify arguments and add support for ARM64 and RV64 Linux
  • Loading branch information
aaronfranke committed Jun 1, 2022
1 parent eaaf941 commit e5c4351
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 85 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,48 @@ jobs:
os: ubuntu-18.04
platform: linux
artifact-name: godot-cpp-linux-glibc2.27-x86_64-release
artifact-path: bin/libgodot-cpp.linux.release.64.a
artifact-path: bin/libgodot-cpp.linux.release.x86_64.a

- name: 🐧 Linux (GCC, Double Precision)
os: ubuntu-18.04
platform: linux
artifact-name: godot-cpp-linux-glibc2.27-x86_64-double-release
artifact-path: bin/libgodot-cpp.linux.release.64.a
artifact-path: bin/libgodot-cpp.linux.release.x86_64.a
flags: float=64

- name: 🏁 Windows (x86_64, MSVC)
os: windows-2019
platform: windows
artifact-name: godot-cpp-windows-msvc2019-x86_64-release
artifact-path: bin/libgodot-cpp.windows.release.64.lib
artifact-path: bin/libgodot-cpp.windows.release.x86_64.lib

- name: 🏁 Windows (x86_64, MinGW)
os: windows-2019
platform: windows
artifact-name: godot-cpp-linux-mingw-x86_64-release
artifact-path: bin/libgodot-cpp.windows.release.64.a
artifact-path: bin/libgodot-cpp.windows.release.x86_64.a
flags: use_mingw=yes

- name: 🍎 macOS (universal)
os: macos-11
platform: osx
artifact-name: godot-cpp-macos-universal-release
artifact-path: bin/libgodot-cpp.osx.release.universal.a
flags: macos_arch=universal
flags: arch=universal

- name: 🤖 Android (arm64)
os: ubuntu-18.04
platform: android
artifact-name: godot-cpp-android-arm64-release
artifact-path: bin/libgodot-cpp.android.release.arm64v8.a
flags: android_arch=arm64v8
artifact-path: bin/libgodot-cpp.android.release.arm64.a
flags: arch=arm64

- name: 🍏 iOS (arm64)
os: macos-11
platform: ios
artifact-name: godot-cpp-ios-arm64-release
artifact-path: bin/libgodot-cpp.ios.release.arm64.a
flags: arch=arm64

steps:
- name: Checkout
Expand Down
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ so formatting is done before your changes are submitted.

## Getting Started

It's a bit similar to what it was for 3.x but also a bit different. This new approach is much more akin to how core Godot modules are structured.
It's a bit similar to what it was for 3.x but also a bit different.
This new approach is much more akin to how core Godot modules are structured.

Compiling this repository generates a static library to be linked with your shared lib,
just like before.

To use the shared lib in your Godot project you'll need a `.gdextension` file, which replaces what was the `.gdnlib` before. Follow the example:
To use the shared lib in your Godot project you'll need a `.gdextension`
file, which replaces what was the `.gdnlib` before.
Follow [the example](test/demo/example.gdextension):

```ini
[configuration]
Expand All @@ -56,15 +59,17 @@ entry_symbol = "example_library_init"

[libraries]

linux.64.debug = "bin/libgdexample.linux.debug.64.so"
linux.64.release = "bin/libgdexample.linux.release.64.so"
windows.64.debug = "bin/libgdexample.windows.debug.64.dll"
windows.64.release = "bin/libgdexample.windows.release.64.dll"
macos.debug = "bin/libgdexample.debug.framework"
macos.release = "bin/libgdexample.release.framework"
macos.debug = "bin/libgdexample.osx.debug.framework"
macos.release = "bin/libgdexample.osx.release.framework"
windows.debug.x86_64 = "bin/libgdexample.windows.debug.x86_64.dll"
windows.release.x86_64 = "bin/libgdexample.windows.release.x86_64.dll"
linux.debug.x86_64 = "bin/libgdexample.linux.debug.x86_64.so"
linux.release.x86_64 = "bin/libgdexample.linux.release.x86_64.so"
# Repeat for other architectures to support arm64, rv64, etc.
```

The `entry_symbol` is the name of the function that initializes your library. It should be similar to following layout:
The `entry_symbol` is the name of the function that initializes
your library. It should be similar to following layout:

```cpp
extern "C" {
Expand Down
Loading

0 comments on commit e5c4351

Please sign in to comment.