Skip to content

Commit

Permalink
updated godot-cpp to 4.1.3
Browse files Browse the repository at this point in the history
added '_native' test to avoid '.import' folder
added 'web' platform
updated updater
  • Loading branch information
DmitriySalnikov committed Dec 1, 2023
1 parent a229c70 commit 0d725ec
Show file tree
Hide file tree
Showing 27 changed files with 729 additions and 467 deletions.
27 changes: 18 additions & 9 deletions .github/actions/compile_gdextension/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,30 @@ name: Build GDExtension
description: Build GDExtension library
inputs:
platform:
description: Target platform (linux|macos|windows|android|ios|javascript)
description: Target platform (linux|macos|windows|android|ios|web)
required: true
target:
description: Compilation target (editor|template_release|template_debug)
required: true
default: "release"
arch:
description: Arch (universal|x86_32|x86_64|arm32|arm64|rv64|ppc32|ppc64|wasm32)
required: true
default: ""
additional:
description: Any additional arguments
default: ""
artifact:
description: Artifact name
default: "bin"
output_libs_path:
description: Path to compiled libraries
required: true
default: "bin"
use_cache:
description: Use cache
default: "true"
artifact:
description: Artifact name
required: true
default: "bin"
additional:
description: Any additional arguments
default: ""
runs:
using: "composite"
steps:
Expand All @@ -29,6 +36,7 @@ runs:
echo "sha=$(git rev-parse @:./godot-cpp)" >> $GITHUB_OUTPUT
- name: Restore .scons_cache directory
if: inputs.use_cache != 'false'
uses: actions/cache/restore@v3
with:
path: ${{env.SCONS_CACHE}}
Expand Down Expand Up @@ -68,15 +76,15 @@ runs:
run: |
echo "::group::🛠️ GDExtesion Compilation 🛠️"
cd godot-cpp
git apply --ignore-space-change --ignore-whitespace ../patches/visibilty_hidden.patch
git apply --ignore-space-change --ignore-whitespace ../patches/godot_cpp_exclude_unused_classes.patch
git apply --ignore-space-change --ignore-whitespace ../patches/unity_build.patch
git apply --ignore-space-change --ignore-whitespace ../patches/1165.patch
cd ..
scons platform=${{inputs.platform}} arch=${{inputs.arch}} target=${{inputs.target}} addon_output_dir=${{inputs.output_libs_path}} ${{inputs.additional}}
echo "::endgroup::"
- name: Prepare artifact Unix
if: runner.os != 'Windows' && inputs.platform != 'android'
if: runner.os != 'Windows' && inputs.platform != 'android' && inputs.platform != 'web'
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
Expand All @@ -99,6 +107,7 @@ runs:
path: ${{inputs.output_libs_path}}/*

- name: Save .scons_cache directory
if: inputs.use_cache != 'false'
uses: actions/cache/save@v3
with:
path: ${{env.SCONS_CACHE}}
Expand Down
86 changes: 74 additions & 12 deletions .github/workflows/gdextension_build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
name: 🛠️ GDExtension Build
on:
push:
paths:
[
src/**,
.github/**,
"!.github/**/util_*",
"patches/**",
lib_utils.py,
SConstruct,
]
paths: [src/**, .github/**, "!.github/**/util_*", "patches/**", lib_utils.py, SConstruct]
pull_request:
paths: [src/**, .github/**, "!.github/**/util_*", "patches/**", lib_utils.py, SConstruct]
workflow_dispatch:
inputs:
use_cache:
description: Use Cache
default: true
type: boolean
repository_dispatch:

# Stop the same workflow actions
Expand Down Expand Up @@ -48,6 +47,7 @@ jobs:
target: ${{matrix.target}}
arch: ${{matrix.arch}}
output_libs_path: ${{env.OUTPUT_LIBS_PATH}}
use_cache: ${{format('{0}', inputs.use_cache)}} # Cast to string
artifact: windows
additional: lto=yes

Expand Down Expand Up @@ -77,6 +77,7 @@ jobs:
target: ${{matrix.target}}
arch: ${{matrix.arch}}
output_libs_path: ${{env.OUTPUT_LIBS_PATH}}
use_cache: ${{format('{0}', inputs.use_cache)}}
artifact: linux
additional: lto=yes

Expand Down Expand Up @@ -106,6 +107,7 @@ jobs:
target: ${{matrix.target}}
arch: ${{matrix.arch}}
output_libs_path: ${{env.OUTPUT_LIBS_PATH}}
use_cache: ${{format('{0}', inputs.use_cache)}}
artifact: macos
additional: lto=yes macos_deployment_target=10.14

Expand All @@ -121,35 +123,91 @@ jobs:
arch: [arm32, arm64, x86_32, x86_64]
target: [template_debug, template_release]

env:
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/23.2.8568313

steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: recursive

- name: Install Android NDK r23c
uses: nttld/[email protected]
id: setup-ndk
with:
ndk-version: r23c
link-to-sdk: true
local-cache: true

# TODO revisit after some updates of nttld/setup-ndk
- name: Restore Android Symlinks
run: |
directory="${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin"
find "$directory" -type l | while read link; do
current_target=$(readlink "$link")
new_target="$directory/$(basename "$current_target")"
ln -sf "$new_target" "$link"
echo "Changed $(basename "$link") from $current_target to $new_target"
done
- name: Compile GDExtension
uses: ./.github/actions/compile_gdextension
with:
platform: android
target: ${{matrix.target}}
arch: ${{matrix.arch}}
output_libs_path: ${{env.OUTPUT_LIBS_PATH}}
use_cache: ${{format('{0}', inputs.use_cache)}}
artifact: android
additional: lto=yes

# ============================================

web-gdextension:
name: 🕸 Web
runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
arch: [wasm32]
target: [template_debug, template_release]

env:
EM_VERSION: 3.1.39

steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: recursive

- uses: mymindstorm/setup-emsdk@v12
with:
version: ${{env.EM_VERSION}}

- name: Compile GDExtension
uses: ./.github/actions/compile_gdextension
with:
platform: web
target: ${{matrix.target}}
arch: ${{matrix.arch}}
output_libs_path: ${{env.OUTPUT_LIBS_PATH}}
use_cache: ${{format('{0}', inputs.use_cache)}}
artifact: web
additional: lto=yes

# ============================================

collect-gdextension:
needs:
[
windows-gdextension,
linux-gdextension,
macos-gdextension,
android-gdextension,
web-gdextension,
]
name: 📦 Collect GDExtension binaries
runs-on: ubuntu-latest
Expand All @@ -160,6 +218,10 @@ jobs:
with:
path: extracted_files

- name: Remove `gdextension_libs` if the action was restarted
run: |
rm -rf extracted_files/gdextension_libs/
- name: Store all libraries in one directory
run: |
ls -R extracted_files/
Expand Down
23 changes: 16 additions & 7 deletions addons/godot_qoi/qoi.gdextension
Original file line number Diff line number Diff line change
@@ -1,53 +1,62 @@
[configuration]

entry_symbol = "godot_qoi_library_init"
compatibility_minimum = "4.1"
compatibility_minimum = "4.1.3"
reloadable = false

[dependencies]

# example.x86_64 = { "relative or absolute path to the dependency" : "the path relative to the exported project", }

# macos.editor = { }
# windows.editor.x86_64 = { }
# linux.editor.x86_64 = { }
# debug

macos = { }
windows.x86_64 = { }
linux.x86_64 = { }

web.wasm32 = {}

android.arm32 = { }
android.arm64 = { }
android.x86_32 = { }
android.x86_64 = { }

# release

macos.template_release = { }
windows.template_release.x86_64 = { }
linux.template_release.x86_64 = { }

web.template_release.wasm32 = { }

android.template_release.arm32 = { }
android.template_release.arm64 = { }
android.template_release.x86_32 = { }
android.template_release.x86_64 = { }

[libraries]

# macos.editor = "libs/libgodot_qoi.macos.editor.universal.dylib"
# windows.editor.x86_64 = "libs/libgodot_qoi.windows.editor.x86_64.dll"
# linux.editor.x86_64 = "libs/libgodot_qoi.linux.editor.x86_64.so"
# debug

macos = "libs/libgodot_qoi.macos.template_debug.universal.dylib"
windows.x86_64 = "libs/libgodot_qoi.windows.template_debug.x86_64.dll"
linux.x86_64 = "libs/libgodot_qoi.linux.template_debug.x86_64.so"

web.wasm32 = "libs/libgodot_qoi.web.template_debug.wasm32.wasm"

android.arm32 = "libs/libgodot_qoi.android.template_debug.arm32.so"
android.arm64 = "libs/libgodot_qoi.android.template_debug.arm64.so"
android.x86_32 = "libs/libgodot_qoi.android.template_debug.x86_32.so"
android.x86_64 = "libs/libgodot_qoi.android.template_debug.x86_64.so"

# release

macos.template_release = "libs/libgodot_qoi.macos.template_release.universal.dylib"
windows.template_release.x86_64 = "libs/libgodot_qoi.windows.template_release.x86_64.dll"
linux.template_release.x86_64 = "libs/libgodot_qoi.linux.template_release.x86_64.so"

web.template_release.wasm32 = "libs/libgodot_qoi.web.template_release.wasm32.wasm"

android.template_release.arm32 = "libs/libgodot_qoi.android.template_release.arm32.so"
android.template_release.arm64 = "libs/libgodot_qoi.android.template_release.arm64.so"
android.template_release.x86_32 = "libs/libgodot_qoi.android.template_release.x86_32.so"
Expand Down
2 changes: 1 addition & 1 deletion dev_QOI_Library.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33110.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QOI_Library", "dev_QOI_Library.vcxproj", "{4D452F2C-8FBB-476B-A990-1E9E5DB73D32}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QOI_Library", "src\dev_QOI_Library.vcxproj", "{4D452F2C-8FBB-476B-A990-1E9E5DB73D32}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
14 changes: 3 additions & 11 deletions dev_build_godot_cpp.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,15 @@ cd godot-cpp
::set api=custom_api_file="../api.json"
set api=

git apply --ignore-space-change --ignore-whitespace ../patches/visibilty_hidden.patch
git apply --ignore-space-change --ignore-whitespace ../patches/godot_cpp_exclude_unused_classes.patch
git apply --ignore-space-change --ignore-whitespace ../patches/unity_build.patch
git apply --ignore-space-change --ignore-whitespace ../patches/1165.patch
::git apply --ignore-space-change --ignore-whitespace ../patches/debug_string.patch

::title win x64 editor dev
::scons platform=windows target=editor arch=x86_64 dev_build=yes %api% generate_bindings=yes
::if errorlevel 1 ( echo Failed to generate and compile debug godot-cpp source code. Code: %errorlevel% && exit /b %errorlevel% )

title win x64 debug dev
scons platform=windows target=template_debug arch=x86_64 dev_build=yes %api% generate_bindings=yes
if errorlevel 1 ( echo Failed to generate and compile debug godot-cpp source code. Code: %errorlevel% && exit /b %errorlevel% )

::title win x64 editor
::scons platform=windows target=editor arch=x86_64 %api% generate_bindings=yes
::if errorlevel 1 ( echo Failed to generate and compile debug godot-cpp source code. Code: %errorlevel% && exit /b %errorlevel% )

title win x64 debug
scons platform=windows target=template_debug arch=x86_64 %api%
if errorlevel 1 ( echo Failed to generate and compile debug godot-cpp source code. Code: %errorlevel% && exit /b %errorlevel% )
Expand All @@ -28,9 +20,9 @@ scons platform=windows target=template_release arch=x86_64 debug_symbols=no %api
if errorlevel 1 ( echo Failed to compile Windows godot-cpp for x64. Code: %errorlevel% && exit /b %errorlevel% )

title android arm64v8 debug
scons platform=android target=template_debug arch=arm64v8 %api%
scons platform=android target=template_debug arch=arm64v8 ANDROID_HOME="" %api%
if errorlevel 1 ( echo Failed to compile debug Android godot-cpp for arm64v8. Code: %errorlevel% && exit /b %errorlevel% )

title android arm64v8
scons platform=android target=template_release arch=arm64v8 %api%
scons platform=android target=template_release arch=arm64v8 ANDROID_HOME="" %api%
if errorlevel 1 ( echo Failed to compile Android godot-cpp for arm64v8. Code: %errorlevel% && exit /b %errorlevel% )
2 changes: 1 addition & 1 deletion godot-cpp
Submodule godot-cpp updated 47 files
+24 −5 .github/workflows/ci.yml
+1 −1 .github/workflows/static_checks.yml
+4 −0 .gitignore
+21 −5 CMakeLists.txt
+26 −17 README.md
+10 −250 SConstruct
+111 −81 binding_generator.py
+169 −18 gdextension/extension_api.json
+62 −0 include/godot_cpp/classes/editor_plugin_registration.hpp
+1 −1 include/godot_cpp/classes/ref.hpp
+128 −81 include/godot_cpp/classes/wrapped.hpp
+10 −8 include/godot_cpp/core/class_db.hpp
+1 −1 include/godot_cpp/core/memory.hpp
+2 −0 include/godot_cpp/core/method_ptrcall.hpp
+0 −3 include/godot_cpp/godot.hpp
+21 −11 include/godot_cpp/templates/cowdata.hpp
+1 −1 include/godot_cpp/templates/list.hpp
+3 −3 include/godot_cpp/templates/rid_owner.hpp
+4 −4 include/godot_cpp/templates/thread_work_pool.hpp
+79 −50 include/godot_cpp/variant/char_string.hpp
+14 −6 include/godot_cpp/variant/variant.hpp
+8 −0 include/godot_cpp/variant/vector3.hpp
+8 −0 include/godot_cpp/variant/vector3i.hpp
+8 −0 include/godot_cpp/variant/vector4.hpp
+8 −0 include/godot_cpp/variant/vector4i.hpp
+3 −3 src/classes/editor_plugin_registration.cpp
+29 −0 src/classes/wrapped.cpp
+14 −3 src/core/class_db.cpp
+2 −2 src/core/memory.cpp
+45 −16 src/godot.cpp
+107 −98 src/variant/char_string.cpp
+8 −6 src/variant/variant.cpp
+16 −1 test/CMakeLists.txt
+3 −1 test/project/example.gdextension
+54 −0 test/project/main.gd
+54 −0 test/src/example.cpp
+17 −0 test/src/example.h
+22 −8 tools/android.py
+333 −0 tools/godotcpp.py
+31 −6 tools/ios.py
+0 −26 tools/ios_osxcross.py
+2 −0 tools/linux.py
+28 −6 tools/macos.py
+0 −28 tools/macos_osxcross.py
+67 −15 tools/targets.py
+23 −24 tools/web.py
+31 −11 tools/windows.py
Loading

0 comments on commit 0d725ec

Please sign in to comment.