Skip to content

Commit

Permalink
Migrate to gdext (#84)
Browse files Browse the repository at this point in the history
- Fixes #86
- Fixes #104
  • Loading branch information
Ughuuu authored Jun 18, 2024
1 parent 175c45e commit 734aac0
Show file tree
Hide file tree
Showing 246 changed files with 17,406 additions and 13,600 deletions.
20 changes: 20 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[target.wasm32-unknown-emscripten]
rustflags = [
"-C", "link-args=-sSIDE_MODULE=2",
"-C", "link-args=-sUSE_PTHREADS=1",
"-C", "target-feature=+atomics,+bulk-memory,+mutable-globals",
"-Zlink-native-libraries=no"
]
[target.armv7-linux-androideabi]
linker = "armv7a-linux-androideabi31-clang"
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]

[target.aarch64-linux-android]
linker = "aarch64-linux-android31-clang"
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
199 changes: 0 additions & 199 deletions .clang-format

This file was deleted.

2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

22 changes: 10 additions & 12 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,24 @@ assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

Add description here

**To Reproduce**

Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Add steps here

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.
A clear and concise description of what you expected to happen.

**Environment (please complete the following information):**
**Environment:**
- OS: [e.g. Windows]
- Version [e.g. v0.3]
- Godot Version [e.g. v4.2]
- Type [e.g. simd single is the default one from asset store]
- Version [e.g. latest or v0.x]
- Godot Version [e.g. v4.x]
- Type [e.g. simd single 2d]

**Example project(zip)**

Expand Down
71 changes: 22 additions & 49 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,50 @@ name: Physics Server Rapier Build
description: Build Godot Cpp and the Physics Server 2D Extension.

inputs:
platform:
required: true
description: Target platform.
rust_target:
arch:
required: true
default: ''
description: Rust target platform.
rust_extra_flags:
extra_flags:
required: false
default: ''
description: Rust extra flags.
rust_env_flags:
env_flags:
required: false
default: ''
description: RUSTFLAGS env var.
arch:
default: ''
description: Target architecture.
precision:
required: true
description: single or double
features:
required: true
description: simd-nightly,simd-stable,parallel,enhanced-determinism

runs:
using: composite
steps:
- name: Cache .scons_cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.scons-cache/
${{ github.workspace }}/godot-cpp/.scons-cache/
key: ${{ inputs.platform }}_${{ inputs.arch }}_${{ inputs.precision }}_cache
- name: Setup python and scons
uses: ./.github/actions/deps
- name: Build Godot Cpp
- name: Rust Install Nightly
shell: sh
env:
SCONS_CACHE: .scons-cache
SCONS_CACHE_DIR: .scons-cache
run: |
cd godot-cpp && \
scons target=template_debug platform=${{ inputs.platform }} arch=${{ inputs.arch }} generate_bindings=yes precision=${{ inputs.precision }} && \
scons target=template_release platform=${{ inputs.platform }} arch=${{ inputs.arch }} generate_bindings=yes precision=${{ inputs.precision }}
- name: Build Rapier
rustup install nightly
rustup default nightly
rustup target add ${{ inputs.arch }}
cargo update
- name: Build
shell: sh
run: |
cd src/rapier2d-wrapper && \
rustup target add ${{ inputs.rust_target }} && \
cargo build --target=${{ inputs.rust_target }} --release --features="${{ inputs.features }},${{ inputs.precision }}" ${{ inputs.rust_extra_flags}} && \
mkdir -p target/release && \
rm -rf target/release && \
cp -rf target/${{ inputs.rust_target }}/release target/release
cargo +nightly build --target=${{ inputs.arch }} --release --features="${{ inputs.features }}" ${{ inputs.extra_flags}} --no-default-features
env:
RUSTFLAGS: ${{ inputs.rust_env_flags }}
- name: Build Rapier Macos Universal
RUSTFLAGS: ${{ inputs.env_flags }}
- name: Copy to release
shell: sh

# we already built for x86_64-apple-darwin for mac, now build arm64
if: ${{ inputs.platform == 'macos'}}
run: |
cd src/rapier2d-wrapper && mkdir -p target/release && rustup target add aarch64-apple-darwin && \
cargo build --target=aarch64-apple-darwin --release --features="${{ inputs.features }},${{ inputs.precision }}" && \
lipo -create -output target/release/librapier2d_wrapper.a target/aarch64-apple-darwin/release/librapier2d_wrapper.a target/x86_64-apple-darwin/release/librapier2d_wrapper.a
- name: Build Physics Server Rapier
mkdir -p target/release
rm -rf target/release
cp -rf target/${{ inputs.arch }}/release target/release
- name: Build Rapier Macos Universal
shell: sh
env:
SCONS_CACHE: .scons-cache
SCONS_CACHE_DIR: .scons-cache
# we already built for x86_64-apple-darwin for mac, now build arm64
if: ${{ inputs.arch == 'x86_64-apple-darwin'}}
run: |
scons target=template_debug platform=${{ inputs.platform }} arch=${{ inputs.arch }} generate_bindings=no precision=${{ inputs.precision }}
scons target=template_release platform=${{ inputs.platform }} arch=${{ inputs.arch }} generate_bindings=no precision=${{ inputs.precision }}
mkdir -p target/release
rustup target add aarch64-apple-darwin
cargo build --target=aarch64-apple-darwin --release --features="${{ inputs.features }}" --no-default-features
lipo -create -output target/release/libgodot_rapier.dylib target/aarch64-apple-darwin/release/libgodot_rapier.dylib target/x86_64-apple-darwin/release/libgodot_rapier.dylib
34 changes: 0 additions & 34 deletions .github/actions/deps/action.yml

This file was deleted.

Loading

0 comments on commit 734aac0

Please sign in to comment.