Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: godotengine/godot-cpp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: godot-4.1.3-stable
Choose a base ref
...
head repository: godotengine/godot-cpp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: godot-4.1.4-stable
Choose a head ref

Commits on Jan 22, 2024

  1. Add missing int→Variant conversions

    (cherry picked from commit bcac96c)
    Repiteo authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    e8b6887 View commit details
  2. CI: Install Android NDK r23c explicitly

    It has just been removed from the Ubuntu 20.04 default install,
    breaking our CI setup.
    
    Also, sets Emscripten version to 3.1.39, as done upstream.
    Newer versions actually break dynamic library support.
    
    (cherry picked from commit eea33b4)
    akien-mga authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    92449b4 View commit details
  3. [iOS] Fix initialisation/termination of multiple statically linked ex…

    …tensions.
    
    (cherry picked from commit adc9def)
    bruvzg authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    b622b11 View commit details
  4. Bump mymindstorm/setup-emsdk from 12 to 13

    Bumps [mymindstorm/setup-emsdk](https://github.com/mymindstorm/setup-emsdk) from 12 to 13.
    - [Release notes](https://github.com/mymindstorm/setup-emsdk/releases)
    - [Commits](mymindstorm/setup-emsdk@v12...v13)
    
    ---
    updated-dependencies:
    - dependency-name: mymindstorm/setup-emsdk
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    (cherry picked from commit 78bf5a4)
    dependabot[bot] authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    cd90415 View commit details
  5. [Scons] Set the minimum Android API level to 21

    (cherry picked from commit 79d2a9c)
    DmitriySalnikov authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    51aeda7 View commit details
  6. Prevent CMake from always including debug symbols

    (cherry picked from commit db884e9)
    bytzo authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    6bb4b1d View commit details
  7. Fix file list issues when trying to build with meson via cmake

    (cherry picked from commit 39c139c)
    LAK132 authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    d5a2e8e View commit details
  8. Send NOTIFICATION_POSTINITIALIZE to extension classes

    (cherry picked from commit 20c4e84)
    dsnopek committed Jan 22, 2024
    Copy the full SHA
    b1bd58d View commit details
  9. Avoid error from -Werror=type-limits on GCC 11

    (cherry picked from commit cad5be5)
    dsnopek committed Jan 22, 2024
    Copy the full SHA
    e9273e8 View commit details
  10. CMake: Remove hardcoded warnings list and forcing -Werror on library …

    …builds
    
    The CMake buildsystem should be completely reviewed to properly match
    what is done by SCons, instead of making its own arbitrary decisions on
    how godot-cpp should be compiled.
    
    Currently the SCons setup doesn't include warning options, so CMake
    shouldn't either. Options similar to upstream Godot's SCons setup could
    be added, and then replicated for CMake.
    
    (cherry picked from commit 41517ea)
    akien-mga authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    2e42c70 View commit details
  11. Bump actions/setup-python from 4 to 5

    Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
    - [Release notes](https://github.com/actions/setup-python/releases)
    - [Commits](actions/setup-python@v4...v5)
    
    ---
    updated-dependencies:
    - dependency-name: actions/setup-python
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    (cherry picked from commit a7becb4)
    dependabot[bot] authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    7561907 View commit details
  12. Allow detecting when building as a GDExtension

    (cherry picked from commit e17c7bf)
    aaronfranke authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    49098fb View commit details
  13. Add an error message if android NDK is not installed

    (cherry picked from commit 718d0ba)
    ArchLinus authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    82475b2 View commit details
  14. Add missing OP_POWER operator to Variant

    (cherry picked from commit f037a69)
    AThousandShips authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    1c03aa7 View commit details
  15. Remove "godot" namespace when binding global constants.

    (cherry picked from commit bd40a94)
    Daylily-Zeleen authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    dde0bbb View commit details
  16. Update README.md with basic pre-requisites

    (cherry picked from commit ee169b2)
    nightblade9 authored and dsnopek committed Jan 22, 2024
    Copy the full SHA
    6884ca9 View commit details

Commits on Jan 24, 2024

  1. Update README: fix godot-cpp issue tracker url

    (cherry picked from commit 8a535d0)
    MJacred authored and dsnopek committed Jan 24, 2024
    Copy the full SHA
    2cc9677 View commit details

Commits on Feb 16, 2024

  1. Merge pull request #1373 from dsnopek/4.1-cherrypicks-7

    Cherry-picks for the godot-cpp 4.1 branch - 7th batch
    dsnopek authored Feb 16, 2024
    Copy the full SHA
    4b63d79 View commit details

Commits on Mar 11, 2024

  1. Switch to 64-bit ints.

    (cherry picked from commit 59a5a8b)
    bruvzg authored and dsnopek committed Mar 11, 2024
    Copy the full SHA
    6202bf1 View commit details
  2. Fix object return value of builtin types' methods.

    (cherry picked from commit 6a3753c)
    Daylily-Zeleen authored and dsnopek committed Mar 11, 2024
    Copy the full SHA
    1ac8627 View commit details
  3. [SCons] Add support for custom build tools and platforms

    Use with:
    
    `scons platform=os2 custom_tools=/path/to/tools`
    
    (assuming you have an `os2.py` inside `/path/to/tools/`)
    
    (cherry picked from commit baaad7a)
    Faless authored and dsnopek committed Mar 11, 2024
    Copy the full SHA
    bab62a4 View commit details
  4. [SCons] Split targets.py, apply flags from tools

    Split `targets` tool logic, moving all the compiler-specific flags to a
    new `common_compiler_flags.py` file, and everything else (CPPDEFINES,
    optimize option logic, dev build logic, etc) to the `godotcpp` tool.
    
    The default tools now apply the common compiler flags by importing the
    file and explicitly calling `configure`.
    
    (cherry picked from commit 16df4bf)
    Faless authored and dsnopek committed Mar 11, 2024
    Copy the full SHA
    670c4d0 View commit details
  5. [Core] Improve CowData and Memory metadata alignment.

    (cherry picked from commit b173a4d)
    bruvzg authored and dsnopek committed Mar 11, 2024
    Copy the full SHA
    08da55c View commit details
  6. Fix _notification with parent and child classes

    (cherry picked from commit 23c0109)
    dsnopek committed Mar 11, 2024
    Copy the full SHA
    f7a9d32 View commit details
  7. Fix explicit namespaces in macros

    (cherry picked from commit e607790)
    Zylann authored and dsnopek committed Mar 11, 2024
    Copy the full SHA
    ed576f8 View commit details
  8. Fix invalid void return in BitField

    (cherry picked from commit 7ed8ef7)
    AThousandShips authored and dsnopek committed Mar 11, 2024
    Copy the full SHA
    07e245e View commit details

Commits on Apr 8, 2024

  1. [Packed*Array] Add support for initializer lists.

    (cherry picked from commit 8c98a90)
    bruvzg authored and dsnopek committed Apr 8, 2024
    Copy the full SHA
    e99d7b3 View commit details
  2. Avoid creating most objects that Godot is going to use placement new …

    …to initialize
    
    (cherry picked from commit c4fde85)
    dsnopek committed Apr 8, 2024
    Copy the full SHA
    76d6ce7 View commit details
  3. Enforce template syntax typename over class

    (cherry picked from commit 87f5fb0)
    Repiteo authored and dsnopek committed Apr 8, 2024
    Copy the full SHA
    9e48c45 View commit details
  4. Change cmake_minimum_required to match actual requirements

    This is because target_link_options was added in v3.13
    So this wouldn't build with cmake v3.12
    
    Likewise in CMAKE_CXX_STANDARD only supports value of 17 starting with
    cmake v3.9
    So the test wouldn't build properly with cmake v3.6
    
    (cherry picked from commit 5c12bd2)
    ytnuf authored and dsnopek committed Apr 8, 2024
    Copy the full SHA
    594a93f View commit details
  5. Fix incorrect utility call signature

    (cherry picked from commit d055b57)
    AThousandShips authored and dsnopek committed Apr 8, 2024
    Copy the full SHA
    c8fa4c0 View commit details
  6. Merge pull request #1411 from dsnopek/4.1-cherrypicks-8

    Cherry-picks for the godot-cpp 4.1 branch - 8th batch
    dsnopek authored Apr 8, 2024
    Copy the full SHA
    974e6c6 View commit details

Commits on Apr 17, 2024

  1. Use GDREGISTER defines in example

    (cherry picked from commit a537b4a)
    Repiteo authored and dsnopek committed Apr 17, 2024
    Copy the full SHA
    8e5d7c9 View commit details
  2. Bump mymindstorm/setup-emsdk from 13 to 14

    Bumps [mymindstorm/setup-emsdk](https://github.com/mymindstorm/setup-emsdk) from 13 to 14.
    - [Release notes](https://github.com/mymindstorm/setup-emsdk/releases)
    - [Commits](mymindstorm/setup-emsdk@v13...v14)
    
    ---
    updated-dependencies:
    - dependency-name: mymindstorm/setup-emsdk
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    (cherry picked from commit 32ca574)
    dependabot[bot] authored and dsnopek committed Apr 17, 2024
    Copy the full SHA
    7f3e725 View commit details
  3. Implement verbose toggle from godot repo

    (cherry picked from commit b05c21b)
    Repiteo authored and dsnopek committed Apr 17, 2024
    Copy the full SHA
    28a6609 View commit details
  4. Fix Projection create_orthogonal being incorrect

    Title
    
    (cherry picked from commit e4ae69f)
    thimenesup authored and dsnopek committed Apr 17, 2024
    Copy the full SHA
    e897dbe View commit details
  5. Fix PropertyInfo to use hint/usage default constants

    (cherry picked from commit e160966)
    Naros authored and dsnopek committed Apr 17, 2024
    Copy the full SHA
    30ebe5f View commit details
  6. Merge pull request #1441 from dsnopek/4.1-cherrypicks-9

    Cherry-picks for the godot-cpp 4.1 branch - 9th batch
    dsnopek authored Apr 17, 2024
    Copy the full SHA
    e497855 View commit details
  7. gdextension: Sync with upstream commit fe0e8e55752b0c2e64997025717b49…

    …1703e0f8ad (4.1.4-stable)
    dsnopek committed Apr 17, 2024
    Copy the full SHA
    4b0ee13 View commit details
Showing with 1,211 additions and 757 deletions.
  1. +18 −17 .github/workflows/ci.yml
  2. +3 −15 CMakeLists.txt
  3. +6 −3 README.md
  4. +66 −24 binding_generator.py
  5. +19 −16 gdextension/extension_api.json
  6. +2 −2 include/godot_cpp/classes/editor_plugin_registration.hpp
  7. +8 −8 include/godot_cpp/classes/ref.hpp
  8. +4 −4 include/godot_cpp/classes/wrapped.hpp
  9. +36 −36 include/godot_cpp/core/binder_common.hpp
  10. +17 −5 include/godot_cpp/core/builtin_ptrcall.hpp
  11. +16 −16 include/godot_cpp/core/class_db.hpp
  12. +1 −1 include/godot_cpp/core/defs.hpp
  13. +7 −7 include/godot_cpp/core/engine_ptrcall.hpp
  14. +2 −2 include/godot_cpp/core/math.hpp
  15. +41 −19 include/godot_cpp/core/memory.hpp
  16. +21 −21 include/godot_cpp/core/method_bind.hpp
  17. +3 −3 include/godot_cpp/core/method_ptrcall.hpp
  18. +12 −12 include/godot_cpp/core/object.hpp
  19. +2 −2 include/godot_cpp/core/property_info.hpp
  20. +5 −5 include/godot_cpp/core/type_info.hpp
  21. +25 −7 include/godot_cpp/godot.hpp
  22. +189 −99 include/godot_cpp/templates/cowdata.hpp
  23. +5 −5 include/godot_cpp/templates/hash_map.hpp
  24. +3 −3 include/godot_cpp/templates/hash_set.hpp
  25. +5 −5 include/godot_cpp/templates/hashfuncs.hpp
  26. +5 −5 include/godot_cpp/templates/list.hpp
  27. +3 −3 include/godot_cpp/templates/local_vector.hpp
  28. +8 −8 include/godot_cpp/templates/pair.hpp
  29. +1 −1 include/godot_cpp/templates/rb_map.hpp
  30. +1 −1 include/godot_cpp/templates/rb_set.hpp
  31. +3 −3 include/godot_cpp/templates/rid_owner.hpp
  32. +11 −2 include/godot_cpp/templates/safe_refcount.hpp
  33. +1 −1 include/godot_cpp/templates/search_array.hpp
  34. +1 −1 include/godot_cpp/templates/self_list.hpp
  35. +2 −2 include/godot_cpp/templates/sort_array.hpp
  36. +3 −3 include/godot_cpp/templates/thread_work_pool.hpp
  37. +59 −44 include/godot_cpp/templates/vector.hpp
  38. +1 −1 include/godot_cpp/templates/vmap.hpp
  39. +1 −1 include/godot_cpp/templates/vset.hpp
  40. +13 −13 include/godot_cpp/variant/char_string.hpp
  41. +1 −1 include/godot_cpp/variant/typed_array.hpp
  42. +17 −5 include/godot_cpp/variant/variant.hpp
  43. +6 −0 src/classes/wrapped.cpp
  44. +6 −6 src/core/memory.cpp
  45. +75 −20 src/godot.cpp
  46. +21 −21 src/variant/char_string.cpp
  47. +20 −20 src/variant/packed_arrays.cpp
  48. +1 −1 src/variant/projection.cpp
  49. +49 −51 src/variant/variant.cpp
  50. +1 −23 test/CMakeLists.txt
  51. +11 −0 test/project/main.gd
  52. +2 −0 test/project/main.tscn
  53. +43 −0 test/src/example.cpp
  54. +33 −0 test/src/example.h
  55. +7 −5 test/src/register_types.cpp
  56. +12 −5 tools/android.py
  57. +86 −0 tools/common_compiler_flags.py
  58. +176 −27 tools/godotcpp.py
  59. +3 −0 tools/ios.py
  60. +3 −0 tools/linux.py
  61. +3 −0 tools/macos.py
  62. +0 −144 tools/targets.py
  63. +3 −0 tools/web.py
  64. +3 −2 tools/windows.py
35 changes: 18 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ jobs:
platform: android
artifact-name: godot-cpp-android-arm64-release
artifact-path: bin/libgodot-cpp.android.template_release.arm64.a
flags: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME arch=arm64
flags: arch=arm64
run-tests: false
cache-name: android-arm64

@@ -88,7 +88,7 @@ jobs:

env:
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
EM_VERSION: 3.1.45
EM_VERSION: 3.1.39
EM_CACHE_FOLDER: "emsdk-cache"

steps:
@@ -104,51 +104,52 @@ jobs:
continue-on-error: true

- name: Set up Python (for SCons)
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Linux dependencies
if: ${{ matrix.platform == 'linux' }}
run: |
sudo apt-get update -qq
sudo apt-get install -qqq build-essential pkg-config
- name: Android dependencies
if: ${{ matrix.platform == 'android' }}
uses: nttld/setup-ndk@v1
with:
ndk-version: r23c
link-to-sdk: true

- name: Web dependencies
if: ${{ matrix.platform == 'web' }}
uses: mymindstorm/setup-emsdk@v12
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}

- name: Install scons
run: |
python -m pip install scons==4.0.0
- name: Setup MinGW for Windows/MinGW build
if: ${{ matrix.platform == 'windows' && matrix.flags == 'use_mingw=yes' }}
uses: egor-tensin/setup-mingw@v2
with:
version: 12.2.0

- name: Install scons
run: |
python -m pip install scons==4.0.0
- name: Generate godot-cpp sources only
run: |
scons platform=${{ matrix.platform }} build_library=no ${{ matrix.flags }}
scons platform=${{ matrix.platform }} verbose=yes build_library=no ${{ matrix.flags }}
scons -c
- name: Build godot-cpp (debug)
run: |
scons platform=${{ matrix.platform }} target=template_debug ${{ matrix.flags }}
scons platform=${{ matrix.platform }} verbose=yes target=template_debug ${{ matrix.flags }}
- name: Build test without rebuilding godot-cpp (debug)
run: |
cd test
scons platform=${{ matrix.platform }} target=template_debug ${{ matrix.flags }} build_library=no
scons platform=${{ matrix.platform }} verbose=yes target=template_debug ${{ matrix.flags }} build_library=no
- name: Build test and godot-cpp (release)
run: |
cd test
scons platform=${{ matrix.platform }} target=template_release ${{ matrix.flags }}
scons platform=${{ matrix.platform }} verbose=yes target=template_release ${{ matrix.flags }}
- name: Download latest Godot artifacts
uses: dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
18 changes: 3 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
# Todo
# Test build for Windows, Mac and mingw.

cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.13)
project(godot-cpp LANGUAGES CXX)

option(GENERATE_TEMPLATE_GET_NODE "Generate a template version of the Node class's get_node." ON)
@@ -47,11 +47,6 @@ option(GODOT_CPP_WARNING_AS_ERROR "Treat warnings as errors" OFF)
# Add path to modules
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" )

# Check if we are building ourself or being included
if(${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME})
set(GODOT_CPP_BUILDING_SELF ON)
endif()

# Set some helper variables for readability
set( compiler_is_clang "$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:Clang>>" )
set( compiler_is_gnu "$<CXX_COMPILER_ID:GNU>" )
@@ -99,10 +94,8 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")

add_definitions(-DNOMINMAX)
else() # GCC/Clang
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -g")

if(CMAKE_BUILD_TYPE MATCHES Debug)
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -fno-omit-frame-pointer -O0")
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -fno-omit-frame-pointer -O0 -g")
else()
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -O3")
endif(CMAKE_BUILD_TYPE MATCHES Debug)
@@ -134,6 +127,7 @@ endif()
execute_process(COMMAND "${Python3_EXECUTABLE}" "-c" "import binding_generator; binding_generator.print_file_list(\"${GODOT_GDEXTENSION_API_FILE}\", \"${CMAKE_CURRENT_BINARY_DIR}\", headers=True, sources=True)"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GENERATED_FILES_LIST
OUTPUT_STRIP_TRAILING_WHITESPACE
)

add_custom_command(OUTPUT ${GENERATED_FILES_LIST}
@@ -159,12 +153,6 @@ add_library(godot::cpp ALIAS ${PROJECT_NAME})

include(GodotCompilerWarnings)

# Treat warnings as errors if we are building ourself
if(GODOT_CPP_BUILDING_SELF)
unset( GODOT_CPP_WARNING_AS_ERROR CACHE )
set_warning_as_error()
endif()

target_compile_features(${PROJECT_NAME}
PRIVATE
cxx_std_17
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ first-party `godot-cpp` extension.
Some compatibility breakage is to be expected as GDExtension and `godot-cpp`
get more used, documented, and critical issues get resolved. See the
[Godot issue tracker](https://github.com/godotengine/godot/issues?q=is%3Aissue+is%3Aopen+label%3Atopic%3Agdextension)
and the [godot-cpp issue tracker](https://github.com/godotengine/godot/issues)
and the [godot-cpp issue tracker](https://github.com/godotengine/godot-cpp/issues)
for a list of known issues, and be sure to provide feedback on issues and PRs
which affect your use of this extension.

@@ -73,7 +73,10 @@ 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.
You need the same C++ pre-requisites installed that are required for the `godot` repository. Follow the [official build instructions for your target platform](https://docs.godotengine.org/en/latest/contributing/development/compiling/index.html#building-for-target-platforms).

Getting started with GDExtensions is 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,
@@ -128,7 +131,7 @@ void initialize_example_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}
ClassDB::register_class<Example>();
GDREGISTER_CLASS(Example);
}
```

Loading