Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
a353be5
Fix -Wmissing-braces warning (included in -Wall) in array constructor…
BenLubar Feb 9, 2025
0a73df5
Check that precision of `extension_api.json` matches build options
dsnopek Feb 21, 2025
2f6d7f2
add gersemi to pre-commit hooks for CMake formatting like black
enetheru Feb 4, 2025
05f5d73
Merge pull request #1722 from enetheru/gersemi
dsnopek Mar 6, 2025
671e309
Updating commenting to be consistent
enetheru Mar 2, 2025
8b33e73
CMake: default target when godot-cpp is top level
enetheru Mar 5, 2025
55cbea7
Merge pull request #1728 from enetheru/default_target
dsnopek Mar 6, 2025
a3f8921
Merge pull request #1723 from enetheru/comments
dsnopek Mar 6, 2025
107cb1d
Style: Integrate `#pragma once` in builders/checks
Repiteo Mar 7, 2025
7056c99
Style: Replace header guards with `#pragma once`
Repiteo Mar 7, 2025
c963321
Ignore `#pragma once` commit
Repiteo Mar 7, 2025
43690cb
Remove unnecessary forced -fno-exceptions for web builds
ytnuf Mar 10, 2025
89abe15
CMake: Target as configuration option
enetheru Mar 9, 2025
0b6350d
Merge pull request #1738 from ytnuf/exception
dsnopek Mar 13, 2025
9f02db1
Merge pull request #1733 from enetheru/single_target_test
dsnopek Mar 13, 2025
a5db125
Merge pull request #1714 from dsnopek/extension-api-precision
dsnopek Mar 13, 2025
d8807a1
Merge pull request #1734 from Repiteo/style/pragma-once
dsnopek Mar 13, 2025
6f981b3
Merge pull request #1704 from BenLubar/missing-braces
dsnopek Mar 13, 2025
f83f364
CMake: XCode dependency chain fixes - remastered
enetheru Mar 11, 2025
5eb16d0
CMake: public/private flags
enetheru Feb 5, 2025
d79959c
binding_generator.py: Don't error if directory already exists
zhmt Feb 7, 2025
aa03c32
Add missing Projection constructor with 16 real_t values
aaronfranke Mar 14, 2025
e4bd867
Merge pull request #1730 from enetheru/XCode
dsnopek Mar 14, 2025
654de13
Merge pull request #1702 from zhmt/master
dsnopek Mar 14, 2025
67ca2fb
Merge pull request #1740 from enetheru/privatise
dsnopek Mar 14, 2025
1edfca2
Synchronize most shared template code with Godot 4.4
dsnopek Feb 25, 2025
075b517
Synchronize most shared variant code with Godot 4.4
dsnopek Feb 21, 2025
2b4802d
Merge pull request #1715 from dsnopek/godot-sync-pre44
dsnopek Mar 14, 2025
f08e781
Merge pull request #1718 from dsnopek/godot-sync-pre44-templates
dsnopek Mar 14, 2025
aed195f
Register the classes used with the Godot editor
dsnopek Mar 14, 2025
d239da3
[macOS] Remove unnecessary Cocoa reference.
bruvzg Mar 28, 2025
f088bc9
Merge pull request #1752 from bruvzg/rem_libs
dsnopek Mar 28, 2025
035add9
Fix stack smashing when Godot methods return `char32_t`, `char16_t` o…
dsnopek Mar 28, 2025
f3deed0
Merge pull request #1753 from dsnopek/stack-smashing-char-types
dsnopek Apr 1, 2025
7ffaecc
Add method_ptrcall header include to type_info to fix compiler errors
tomfull123 Mar 28, 2025
a2c37f8
Made the Array's ptr and ptrw methods private
tomfull123 Feb 22, 2025
b0f4190
Implement `use_static_cpp` flag for Linux
unvermuthet Mar 18, 2025
c2d688b
Merge pull request #1747 from unvermuthet/linux-use-static-cpp
dsnopek Apr 2, 2025
d72baf1
Merge pull request #1742 from aaronfranke/projection-construct
dsnopek Apr 2, 2025
c26e7c9
Merge pull request #1754 from tomfull123/typed-dictionary-compilation…
dsnopek Apr 2, 2025
da064d8
Merge pull request #1717 from tomfull123/typed-array-range-based-loop…
dsnopek Apr 2, 2025
946a693
.
tomfull123 Apr 2, 2025
552a74c
Update test project to Godot 4.4
Calinou Apr 3, 2025
335b490
Added initialiser list support to TypedDictionary
tomfull123 Mar 24, 2025
30bfa6f
SCons: Add `CPPEXTPATH` for external includes
Repiteo Apr 2, 2025
b6c0251
CMake: Update CI
enetheru Mar 11, 2025
7888c15
Merge pull request #1726 from enetheru/continuous_integration
dsnopek Apr 5, 2025
096d905
Merge pull request #1760 from Calinou/update-test-project-4.4
dsnopek Apr 5, 2025
1163d1b
Merge pull request #1750 from tomfull123/typed-dictionary-initializer…
dsnopek Apr 5, 2025
478e263
Merge pull request #1716 from tomfull123/master
dsnopek Apr 5, 2025
38e517b
Fix compatibility break for CI
enetheru Apr 6, 2025
c173cc0
Merge pull request #1761 from enetheru/CI_compat_fix
dsnopek Apr 7, 2025
d634a5f
Synced defs.hpp with godot's typedefs.h
tomfull123 Apr 2, 2025
26201dd
Fix TypedDictionary binding generation
Grublady Apr 9, 2025
7e6c9c9
Use Math::abs to avoid ambiguity with integer abs
Zylann Apr 14, 2025
94a8fad
Merge pull request #1767 from Zylann/quaterion_abs
dsnopek Apr 15, 2025
97ad05b
Merge pull request #1758 from tomfull123/sync-defs
dsnopek Apr 15, 2025
62a5c60
Merge pull request #1763 from Grublady/typeddict
dsnopek Apr 15, 2025
bbbcc6a
version bump of mozilla-sccache action to 0.0.9
enetheru Apr 16, 2025
321af5b
Merge pull request #1768 from enetheru/sccache_update
dsnopek Apr 16, 2025
7670de8
Use Math::abs to avoid ambiguity with integer abs
Zylann Apr 16, 2025
70d8ff0
Merge pull request #1770 from Zylann/basis_abs
dsnopek Apr 16, 2025
2a8d218
Merge pull request #1756 from Repiteo/scons/external-includes
dsnopek Apr 16, 2025
b195a51
Match #1758 build option changes
enetheru Apr 16, 2025
195188f
Merge pull request #1769 from enetheru/defs
dsnopek Apr 17, 2025
08fd033
Merge pull request #1743 from dsnopek/get-used-classes
dsnopek Apr 18, 2025
24c03d8
Merge commit godotengine/godot-cpp@08fd033a9e75bbbed0819b01db41defb00…
Spartan322 Apr 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@

# Rebrand preambles to Redot
d3bd3484fc9baad20a7cc4c9371a5f4dd70744cd

# Style: Replace header guards with `#pragma once`
7056c996dd43ae1aa466c94d95cc2fe63853d8a9
9 changes: 9 additions & 0 deletions .github/actions/setup-godot-cpp/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ inputs:
ndk-version:
default: r23c
description: Android NDK version.
buildtool:
default: scons
description: scons or cmake
scons-version:
default: 4.4.0
description: SCons version.


runs:
using: composite
steps:
Expand Down Expand Up @@ -55,8 +59,13 @@ runs:
version: ${{ inputs.mingw-version }}

- name: Setup SCons
if: ${{ inputs.buildtool == 'scons' }}
shell: bash
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==${{ inputs.scons-version }}
scons --version

- name: Install Ninja
if: ${{ inputs.buildtool == 'cmake' }}
uses: ashutoshvarma/setup-ninja@master
195 changes: 195 additions & 0 deletions .github/workflows/ci-cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
name: Continuous integration
on:
workflow_call:

env:
# Only used for the cache key. Increment version to force clean build.
GODOT_BASE_BRANCH: master
# Used to select the version of Godot to run the tests with.
REDOT_TEST_VERSION: master
# Use UTF-8 on Linux.
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8

concurrency:
group: ci-cmake-${{ github.actor }}-${{ github.head_ref || github.run_number }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-cmake:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
EM_VERSION: 3.1.39
config-flags:
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DGODOTCPP_ENABLE_TESTING=ON
-DGODOTCPP_BUILD_PROFILE="test/build_profile.json"
SCCACHE_GHA_ENABLED: "true"

strategy:
fail-fast: false
matrix:
include:
- name: 🐧 Linux (GCC, Makefiles)
os: ubuntu-22.04
platform: linux
config-flags: -DCMAKE_BUILD_TYPE=Release
artifact-name: godot-cpp-linux-glibc2.27-x86_64-release.cmake
artifact-path: cmake-build/bin/libgodot-cpp.linux.template_release.x86_64.a
run-tests: true

- name: 🐧 Linux (GCC, Makefiles, Double Precision)
os: ubuntu-22.04
platform: linux
config-flags: -DCMAKE_BUILD_TYPE=Release -DGODOTCPP_PRECISION=double
artifact-name: godot-cpp-linux-glibc2.27-x86_64-double-release.cmake
artifact-path: cmake-build/bin/libgodot-cpp.linux.template_release.double.x86_64.a
flags: precision=double
run-tests: false

- name: 🏁 Windows (x86_64, MSVC)
os: windows-2019
platform: windows
compiler: msvc
build-flags: --config Release
artifact-name: godot-cpp-windows-msvc2019-x86_64-release.cmake
artifact-path: cmake-build/bin/libgodot-cpp.windows.template_release.x86_64.lib
run-tests: false

- name: 🏁 Windows (x86_64, MinGW, Ninja)
os: windows-2019
platform: windows
compiler: mingw
config-flags:
-GNinja -DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_COMPILER=cc -DCMAKE_CXX_COMPILER=c++
artifact-name: godot-cpp-linux-mingw-x86_64-release.cmake
artifact-path: cmake-build/bin/libgodot-cpp.windows.template_release.x86_64.a
run-tests: false

- name: 🍎 macOS (universal, Makefiles)
os: macos-latest
platform: macos
config-flags: -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
artifact-name: godot-cpp-macos-universal-release.cmake
artifact-path: cmake-build/bin/libgodot-cpp.macos.template_release.universal.a
run-tests: false

- name: 🤖 Android (arm64, Ninja)
os: ubuntu-22.04
platform: android
config-flags:
-G Ninja -DCMAKE_BUILD_TYPE=Release
--toolchain ${ANDROID_HOME}/ndk/23.2.8568313/build/cmake/android.toolchain.cmake
-DANDROID_PLATFORM=21 -DANDROID_ABI=arm64-v8a
artifact-name: godot-cpp-android-arm64-release.cmake
artifact-path: cmake-build/bin/libgodot-cpp.android.template_release.arm64.a
flags: arch=arm64
run-tests: false

- name: 🍏 iOS (arm64, XCode)
os: macos-latest
platform: ios
config-flags:
-G Xcode
--toolchain cmake/ios.toolchain.cmake
-DPLATFORM=OS64
build-flags: --config Release
artifact-name: godot-cpp-ios-arm64-release.cmake
artifact-path: cmake-build/bin/libgodot-cpp.ios.template_release.arm64.a
flags: arch=arm64
run-tests: false

- name: 🌐 Web (wasm32, Ninja)
os: ubuntu-22.04
platform: web
config-flags:
-G Ninja -DCMAKE_BUILD_TYPE=Release
--toolchain ${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
artifact-name: godot-cpp-web-wasm32-release.cmake
artifact-path: cmake-build/bin/libgodot-cpp.web.template_release.wasm32.a
run-tests: false

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.9

- name: Setup godot-cpp
uses: ./.github/actions/setup-godot-cpp
with:
platform: ${{ matrix.platform }}
windows-compiler: ${{ matrix.compiler }}
buildtool: cmake

- name: Configure godot-cpp-test with template_debug
run: >
cmake --log-level=VERBOSE -S . -B cmake-build ${{ env.config-flags }} ${{ matrix.config-flags }}

- name: Build godot-cpp-test (template_debug)
run: >
cmake --build cmake-build --verbose --target godot-cpp-test ${{ matrix.build-flags }}

- name: Configure godot-cpp-test with template_release
run: >
cmake --fresh --log-level=VERBOSE -S . -B cmake-build
-DGODOTCPP_TARGET=template_release ${{ env.config-flags }} ${{ matrix.config-flags }}

- name: Build godot-cpp-test (template_release)
run: >
cmake --build cmake-build --verbose --target godot-cpp-test ${{ matrix.build-flags }}

- name: Run sccache stat for check
shell: bash
run: ${SCCACHE_PATH} --show-stats

- name: Download latest Redot artifacts
uses: dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
if: matrix.run-tests && env.REDOT_TEST_VERSION == 'master'
with:
repo: Redot-Engine/redot-engine
branch: master
event: push
workflow: linux_builds.yml
workflow_conclusion: success
name: linux-editor-mono
search_artifacts: true
check_artifacts: true
ensure_latest: true
path: redot-artifacts

- name: Prepare Redot artifacts for testing
if: matrix.run-tests && env.REDOT_TEST_VERSION == 'master'
run: |
chmod +x ./redot-artifacts/redot.linuxbsd.editor.x86_64.mono
echo "REDOT=$(pwd)/redot-artifacts/redot.linuxbsd.editor.x86_64.mono" >> $GITHUB_ENV

- name: Download requested Redot version for testing
if: matrix.run-tests && env.REDOT_TEST_VERSION != 'master'
run: |
wget "https://github.com/Redot-Engine/redot-engine/releases/download/redot-${REDOT_TEST_VERSION}/Redot_v${REDOT_TEST_VERSION}_linux.x86_64.zip" -O Redot.zip
unzip -a Redot.zip
chmod +x "Redot_v${REDOT_TEST_VERSION}_linux.x86_64"
echo "REDOT=$(pwd)/Redot_v${REDOT_TEST_VERSION}_linux.x86_64" >> $GITHUB_ENV

- name: Run tests
if: matrix.run-tests
run: |
$REDOT --headless --version
cd test
# Need to run the editor so .godot is generated... but it crashes! Ignore that :-)
(cd project && (timeout 30 $REDOT --import --headless >/dev/null 2>&1 || true))
./run-tests.sh

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ${{ matrix.artifact-path }}
if-no-files-found: error
42 changes: 3 additions & 39 deletions .github/workflows/ci.yml → .github/workflows/ci-scons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ env:
LC_ALL: en_US.UTF-8

concurrency:
group: ci-${{ github.actor }}-${{ github.head_ref || github.run_number }}-${{ github.ref }}
group: ci-scons-${{ github.actor }}-${{ github.head_ref || github.run_number }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
build-scons:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -113,6 +113,7 @@ jobs:
with:
platform: ${{ matrix.platform }}
windows-compiler: ${{ contains(matrix.flags, 'use_mingw=yes') && 'mingw' || 'msvc' }}
buildtool: scons

- name: Generate redot-cpp sources only
run: |
Expand Down Expand Up @@ -183,40 +184,3 @@ jobs:
name: ${{ matrix.artifact-name }}
path: ${{ matrix.artifact-path }}
if-no-files-found: error

linux-cmake-ninja:
name: 🐧 Build (Linux, GCC, CMake Ninja)
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qqq build-essential pkg-config cmake ninja-build

- name: Build test GDExtension library
run: |
mkdir cmake-build
cd cmake-build
cmake ../ -DGODOTCPP_ENABLE_TESTING=YES
cmake --build . --verbose -j $(nproc) -t godot-cpp.test.template_release --config Release

windows-msvc-cmake:
name: 🏁 Build (Windows, MSVC, CMake)
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Build test GDExtension library
run: |
mkdir cmake-build
cd cmake-build
cmake ../ -DGODOTCPP_ENABLE_TESTING=YES
cmake --build . --verbose -t godot-cpp.test.template_release --config Release
56 changes: 50 additions & 6 deletions .github/workflows/runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,57 @@ jobs:
# First stage: Only static checks, fast and prevent expensive builds from running.

static-checks:
if: '!vars.DISABLE_GODOT_CI'
name: 📊 Static Checks
if: '!vars.DISABLE_GODOT_CI'
uses: ./.github/workflows/static_checks.yml

# Second stage: Run all the builds and some of the tests.

ci:
name: 🛠️ Continuous Integration
# Second stage: Review code changes
changes:
name: Analyze Changes
needs: static-checks
uses: ./.github/workflows/ci.yml
runs-on: ubuntu-latest
outputs:
sources: ${{ steps.filter.outputs.sources_any_changed }}
scons: ${{ steps.filter.outputs.scons_any_changed }}
cmake: ${{ steps.filter.outputs.cmake_any_changed }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: tj-actions/changed-files@v45
id: filter
with:
files_yaml: |
sources:
- '.github/workflows/*.yml'
- '**/*.py'
- '**/*.cpp'
- '**/*.h'
- 'test/build_profile.json'
- 'gdextension/extension_api.json'
scons:
- '**/SConstruct'
- '**/SCsub'
- '**/*.py'
cmake:
- '**/CMakeLists.txt'
- '**/*.cmake'
- name: echo sources changed
run: |
echo sources ${{ steps.filter.outputs.sources_any_modified }}
echo scons ${{ steps.filter.outputs.scons_any_modified }}
echo cmake ${{ steps.filter.outputs.cmake_any_modified }}

# Third stage: Run all the builds and some of the tests.

ci-scons:
name: 🛠️ SCons CI
needs: changes
if: ${{ needs.changes.outputs.scons == 'true' || needs.changes.outputs.sources == 'true' }}
uses: ./.github/workflows/ci-scons.yml

ci-cmake:
name: 🛠️ CMake CI
needs: changes
if: ${{ needs.changes.outputs.cmake == 'true' || needs.changes.outputs.sources == 'true' }}
uses: ./.github/workflows/ci-cmake.yml
14 changes: 3 additions & 11 deletions .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,13 @@ jobs:
fetch-depth: 2

- name: Get changed files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
files=$(git diff-tree --no-commit-id --name-only -r HEAD^1..HEAD 2> /dev/null || true)
elif [ "${{ github.event_name }}" == "push" -a "${{ github.event.forced }}" == "false" -a "${{ github.event.created }}" == "false" ]; then
files=$(git diff-tree --no-commit-id --name-only -r ${{ github.event.before }}..${{ github.event.after }} 2> /dev/null || true)
fi
files=$(echo "$files" | grep -v 'thirdparty' | xargs -I {} sh -c 'echo "\"./{}\""' | tr '\n' ' ')
echo "CHANGED_FILES=$files" >> $GITHUB_ENV
id: changed-files
uses: tj-actions/changed-files@v45

- name: Style checks via pre-commit
uses: pre-commit/action@v3.0.1
with:
extra_args: --verbose --hook-stage manual --files ${{ env.CHANGED_FILES }}
extra_args: --verbose --hook-stage manual --files ${{ steps.changed-files.outputs.all_changed_files }}

- name: Check generated files consistency
run:
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ repos:
- id: codespell
additional_dependencies: [tomli]

- repo: https://github.com/BlankSpruce/gersemi
rev: 0.18.2
hooks:
- id: gersemi
args: ["-i", "--no-warn-about-unknown-commands", "-l", "120"]

- repo: local
hooks:
- id: copyright-headers
Expand Down
Loading
Loading