1503 Commits

Author SHA1 Message Date
David Snopek
d5cc777a89 Merge pull request #1803 from dsnopek/4.3-cherrypicks-5
Cherry-picks for the godot-cpp 4.3 branch - 5th batch
2025-07-03 08:52:49 -05:00
David Snopek
b1e2ac5cbb Update CI to use windows-2022
(cherry picked from commit 8938e7e4e3)
2025-06-25 09:16:25 -05:00
David Snopek
53caa6adbc Update CI to use ubuntu-22.04 2025-06-24 14:50:16 -05:00
Tom
a9abdb5f0c Cleaned up the MethodBind class
(cherry picked from commit ca5af3c861)
2025-06-24 12:49:39 -05:00
MJacred
9892f63abb Fix URL to gdextension cpp example in the official docs
(cherry picked from commit f25c4df5c4)
2025-06-24 12:49:28 -05:00
Lukas Tenbrink
7b4ca64761 Make ndk version configurable as a command-like argument.
(cherry picked from commit 16e47d7ae5)
2025-06-24 12:49:17 -05:00
Fabio Alessandrelli
6cdac999c2 fix: Add iOS min SDK version link flags
This is required when publishing to the App Store, and consistent with
what we already do for the macOS deployment target.

(cherry picked from commit 4879eb7bd0)
2025-06-24 12:45:39 -05:00
David Snopek
48544896ee Stop referring to GDExtension as experimental in the README
(cherry picked from commit 7660dd28b3)
2025-06-24 12:45:29 -05:00
Ben Lubar
443c075fa3 fix iterators making unintended copies
(cherry picked from commit 7fd0999b3c)
2025-06-24 12:45:14 -05:00
David Snopek
52937a3850 Fix classes without _to_string() always returning "[Wrapped:0]"
(cherry picked from commit f38c056b67)
2025-06-24 12:43:31 -05:00
Thaddeus Crews
888f46bbcc SCons: Add CPPEXTPATH for external includes
(cherry picked from commit 30bfa6f215)
2025-06-24 12:43:21 -05:00
Aaron Franke
de7e5b9145 Add missing Projection constructor with 16 real_t values
(cherry picked from commit aa03c32b3e)
2025-06-24 12:42:28 -05:00
David Snopek
8fffe3b558 Fix stack smashing when Godot methods return char32_t, char16_t or wchar_t
(cherry picked from commit 035add9d4f)
2025-06-24 12:42:10 -05:00
David Snopek
dcd0842fab Merge pull request #1744 from dsnopek/4.3-cherrypicks-4
Cherry-picks for the godot-cpp 4.3 branch - 4th batch
2025-03-18 08:08:42 -05:00
zhmt
dacaa81f2f binding_generator.py: Don't error if directory already exists
It should be ok when folders exist. Exception shouldn't be thrown.

Update binding_generator.py

It should be ok when folds exist. It will fail to build without this patch,  in vs code on windows with compiler ( visual studio community 2022 amd 64) .

Co-Authored-By: Chris Cranford <ccranfor@redhat.com>
(cherry picked from commit d79959c79e)
2025-03-17 10:52:48 -05:00
David Snopek
40e65753f9 Check that precision of extension_api.json matches build options
(cherry picked from commit 0a73df5f53)
2025-03-17 10:52:37 -05:00
Thaddeus Crews
2dee0cc4de Style: Replace _NO_DISCARD_ macro with [[nodiscard]]
(cherry picked from commit 89fd27608f)
2025-03-17 10:50:49 -05:00
dependabot[bot]
3f454d142d Bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit b17e668c15)
2025-03-17 10:48:14 -05:00
David Snopek
f3a1a2fd45 Merge pull request #1695 from dsnopek/4.3-cherrypicks-3
Cherry-picks for the godot-cpp 4.3 branch - 3rd batch
2025-01-28 11:28:57 -06:00
Brecht Kuppens
08e4c89da9 Fix buffer overrun with enums pointers cast to int64_t* when enum is only 32-bit
(cherry picked from commit 7576dc5930)
2025-01-28 10:37:36 -06:00
Brecht Kuppens
86d0dbe695 Update README.md with new pre-commit instructions
(cherry picked from commit bd3cf478c6)
2025-01-28 10:37:36 -06:00
Fabio Alessandrelli
dc87cb6b97 [CI] Re-add generated files consistency check
(cherry picked from commit 0cfe01eff2)
2025-01-28 10:37:36 -06:00
Fabio Alessandrelli
4b9cd6ae9d [Bindings] Build profile now strips methods and skip files
This allows removing dependencies that are not explicitly unused by the
gdextension being built and is implemented using an intermediate json
API file with the methods and classes stripped (i.e. without touching
the file generators).

(cherry picked from commit c4f1abe3f9)
2025-01-28 10:37:36 -06:00
David Snopek
fba9ecd0da Fix print_verbose() macro conflicting with UtilityFunctions::print_verbose()
(cherry picked from commit 47d9cb9bed)
2025-01-28 10:37:36 -06:00
Lukas Tenbrink
59ad323dd1 Add a separate setup-godot-cpp github action.
(cherry picked from commit 9943675dcb)
2025-01-28 10:37:36 -06:00
Aaron Franke
9dc2e15d90 Add print_line for compatibility with engine modules
(cherry picked from commit ac466e4766)
2025-01-28 10:37:36 -06:00
A Thousand Ships
2d96b62774 [Web] Don't cache emsdk
Due to how caches are accessed this cache is almost useless, it only
matters if it is from the same branch or a base branch, and is identical
between branches, so caching it just clutters the build cache

(cherry picked from commit 1e3b24f658)
2025-01-28 10:37:36 -06:00
David Snopek
2cd6221286 Sync Quaternion with the version in Godot
(cherry picked from commit 2004af63a0)
2025-01-28 10:37:36 -06:00
ruffenman
d6a47a28c7 Remove unimplemented static variant functions 'blend' and 'interpolate'. If a user attempts to call either of these it will introduce a linker error and it may not be immediately clear to them why. Also, variant interpolation can already be accessed via 'UtilityFunctions::lerp', making at least the interpolate function unecessary here.
(cherry picked from commit 42a35a1852)
2025-01-28 10:37:36 -06:00
Thaddeus Crews
f2303ba0cc CI: Add runner workflow to call other workflows
(cherry picked from commit c1524f7c86)
2025-01-28 10:37:36 -06:00
Zhehang Ding
c9da56cca2 Use namespace in defs.hpp
A global alias of godot::real_t is defined for backward compatibility

(cherry picked from commit 450c3d65cd)
2025-01-28 10:37:36 -06:00
David Snopek
3449c4e1d3 Don't print an error when decoding a null Ref<T>
(cherry picked from commit 7f02301a91)
2025-01-28 10:37:36 -06:00
Lukas Tenbrink
0899cf6098 Rename Vector4.components -> coords.
The use of .components is deprecated.

(cherry picked from commit 23c9d41d2a)
2025-01-28 10:37:36 -06:00
Lukas Tenbrink
06fbf3ce95 Add lto scons option, defaulting to "none".
(cherry picked from commit 5f7cf05043)
2025-01-28 10:37:36 -06:00
David Snopek
d5bdde9509 Avoid thread_local on MacOS to prevent issues with hot reload
(cherry picked from commit 91833c852e)
2025-01-28 10:37:36 -06:00
David Snopek
9ded2402dc Fix crash in ClassDB::add_virtual_method() if arguments metadata is the wrong size
(cherry picked from commit 1e169bb809)
2025-01-28 10:37:36 -06:00
David Snopek
575f317bf1 [4.3] Run tests against Godot 4.3-stable 2025-01-28 10:37:36 -06:00
David Snopek
56571dc584 Merge pull request #1632 from dsnopek/4.3-cherrypicks-2
Cherry-picks for the godot-cpp 4.3 branch - 2nd batch
2024-10-30 09:38:31 -05:00
Florent Guiocheau
94d74979ce Add p_use_model_front to Basis::looking_at()
(cherry picked from commit 02fd535454)
2024-10-28 16:32:13 -05:00
Thaddeus Crews
bf26191ead SCons: Don't cache librarys
(cherry picked from commit 83c0f15ab9)
2024-10-28 16:32:02 -05:00
Fabio Alessandrelli
af78f2778f [SCons] Enable WASM_BIGINT in web builds
Required since Godot 4.3, which is also the first Godot version with
wide WASM gdnative support (previous versions were Chrome-only, and very
brittle).

(cherry picked from commit 78498da7c3)
2024-10-28 16:31:51 -05:00
Fabio Alessandrelli
30a395bf43 [SCons] Remove use_clang_cl windows flag in favor of generic use_llvm
This is consistent with Godot upstream.

(cherry picked from commit 4717a78144)
2024-10-28 16:31:40 -05:00
Samuel Nicholas
a3d5d6d4d3 VSProj Configure type on build command - to resolve #1582
Visual Studio projects are multi-config projects like Ninja-MultiConfig which means you can't set the configuration at configure time as there are multiple, it always chooses the first one by default when not specified in the build command.

Instead of this:
cmake -DCMAKE_BUILD_TYPE=Release -G"Visual Studio 17 2022" .
cmake --build . --verbose

It should be this
cmake -G"Visual Studio 17 2022" .
cmake --build . --verbose --config Release

Update ci.yml

Because the current build system doesnt use generator expressions for multi config builds, both the CMAKE_BUILD_TYPE and the build --config options need to be set

(cherry picked from commit 07704f8f48)
2024-10-28 16:31:31 -05:00
Samuel Nicholas
e751531290 update .gitignore to add .idea for the Jetbrains CLion IDE
and also the default cmake build directory when building in clion cmake-build-*

(cherry picked from commit 9f5daa2d90)
2024-10-28 16:31:22 -05:00
Samuel Nicholas
2de650b82a Re-Structure cmake solution to be closer to the scons solution.
This is just a single step, re-arranging the code without actually changing its functionality.

new docs/cmake.md
moved the block of comments from the start of the CMakeLists.txt into the cmake.md file and converted content to markdown.

new cmake/godotcpp.cmake
Moved all exposed options into a new function godotcpp_options()
Moved configuration and generation code into godotcpp_generate()

To get all the options into the godotcpp_options() I changed the logic of GODOT_USE_HOT_RELOAD which I believe is a closer match to scons, that if the options is not set, and the build type is not release, then it defaults to ON.

I msvc builds require the default flags to be modified or it will throw errors. I have added the links to articles in the commit, but its about removing the runtime error checks /RTC1 from the CMAKE_CXX_FLAGS_DEBUG variable. This needs to happen before the files are included.
https://stackoverflow.com/questions/74426638/how-to-remove-rtc1-from-specific-target-or-file-in-cmake
https://discourse.cmake.org/t/how-do-i-remove-compile-options-from-target/5965

Renamed GodotCompilerWarnings.cmake to common_compiler_flags.cmake to match scons

Included files explicitly by path, as we dont need to append to the CMAKE_MODULES_PATH which effects the whole build tree.

This prevents consumers of the library from clobbering the names of the cmake include files and breaking the build.

(cherry picked from commit 2402a044eb)
2024-10-28 16:31:12 -05:00
David Snopek
5fe58bcd1e Correctly set instance bindings on reload
(cherry picked from commit cb543c192a)
2024-10-28 16:31:03 -05:00
Samuel Nicholas
daf8ac1c33 Updated all variable names to use GODOT_ prefix
changed cache type for api file and api dir to FILEPATH and PATH respectively.
Minor whitespace.
docstring parity

(cherry picked from commit 390a9a5590)
2024-10-28 16:30:54 -05:00
Samuel Nicholas
b12aeb1b38 Add GODOT_SYMBOL_VISIBILITY cache variable to match scons interface.
(cherry picked from commit 02bdc6665a)
2024-10-28 16:30:45 -05:00
Andreas Pokorny
fa0b4cffc0 Add visibility-hidden
This should make all symbols that are not marked otherwise have hidden
visibility. There still may be exposed symbols if marked with respective
attributes.

(cherry picked from commit d18fa929fb)
2024-10-28 16:30:35 -05:00
ytnuf
e52b4ea4fd Add hot reload support when building with GCC and CMake
(cherry picked from commit 05571971cc)
2024-10-28 16:30:21 -05:00