Commit Graph

1475 Commits (2402a044ebc2189f6c725b9a64c66c9bc2e5c616)

Author SHA1 Message Date
Samuel Nicholas 2402a044eb 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.
2024-09-24 16:27:28 +09:30
David Snopek 64221facda
Merge pull request #1603 from Faless/build/fix_wasm_bigint
[SCons] Enable WASM_BIGINT in web builds
2024-09-23 10:45:56 -05:00
Fabio Alessandrelli 78498da7c3 [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).
2024-09-23 13:29:49 +02:00
David Snopek 57bd88ad99
Merge pull request #1162 from Repiteo/typed-dictionary
Implement typed dictionaries
2024-09-19 13:46:07 -05:00
David Snopek b93d6e887e
Merge pull request #1583 from enetheru/variable-rename2
Updated all variable names to use GODOT_ prefix
2024-09-17 21:00:36 -05:00
Thaddeus Crews 2ffff669f5
Implement typed dictionaries 2024-09-17 15:05:16 -05:00
David Snopek 730ccaae39
Merge pull request #1593 from Repiteo/4.4.dev2-bindings
Update bindings to 4.4.dev2
2024-09-17 14:38:47 -05:00
Thaddeus Crews 9b98b19913
Update bindings to 4.4.dev2 2024-09-17 12:45:21 -05:00
Samuel Nicholas 390a9a5590 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
2024-09-14 09:04:01 +09:30
David Snopek 4131b7f95f
Merge pull request #1579 from enetheru/visibility-hidden
add SYMBOL_VISIBILITY cache variable to match scons interface.
2024-09-13 17:49:28 -05:00
Samuel Nicholas 02bdc6665a Add GODOT_SYMBOL_VISIBILITY cache variable to match scons interface. 2024-09-14 07:47:29 +09:30
David Snopek aed9b5c7df
Merge pull request #1563 from APokorny/visibility-hidden
Add visibility-hidden to CMake build
2024-09-11 10:29:12 -05:00
David Snopek 4d8c05f405
Merge pull request #1535 from bruvzg/llvm-mingw-arm64
Add support for LLVM/MinGW and ARM64 Windows builds.
2024-09-10 15:48:22 -05:00
David Snopek f4d3817d99
Merge pull request #1548 from ytnuf/hot_reload
Add hot reload support when building with GCC and CMake
2024-09-10 15:47:53 -05:00
David Snopek d477589104
Merge pull request #1520 from dsnopek/test-library-path-absolute
Add a test to ensure that library path is absolute
2024-08-27 17:45:23 -05:00
ytnuf 05571971cc Add hot reload support when building with GCC and CMake 2024-08-26 19:54:55 +01:00
David Snopek aac0164b7a
Merge pull request #1561 from Spartan322/gcc-14-Wtemplate-id-cdtor-warning
Fix GCC 14 -Wtemplate-id-cdtor warning
2024-08-26 12:35:48 -05:00
David Snopek fd8f196008
Merge pull request #1560 from Faless/fix/build_web_cppflags_is_ccflags
[Web/SCons] Use CCFLAGS for SIDE_MODULE option
2024-08-26 10:34:55 -05:00
David Snopek 16bc0a0fff
Merge pull request #1558 from aaronfranke/fix-typed-packed-array-bind
Fix missing MAKE_TYPED_ARRAY_INFO for Packed*Arrays
2024-08-26 10:34:33 -05:00
Andreas Pokorny d18fa929fb 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.
2024-08-26 13:20:51 +02:00
George L. Albany 7b31f39bea
Fix GCC 14 -Wtemplate-id-cdtor warning
As was fixed with godotengine/godot#91208
2024-08-25 07:55:58 +00:00
Fabio Alessandrelli f36acd8e31 [Web/SCons] Use CCFLAGS for SIDE_MODULE option
Was using CPPFLAGS, but should use the explicit scons CCFLAGS which
makes it clear they are applied to both the C and C++ compiler.

CPPFLAGS was also fine (they are preprocessor flags, also applied to
both C and C++), but we should try to stay consistent with what we do
in Godot.
2024-08-24 12:02:36 +02:00
Aaron Franke 10c3d1bc5f
Fix missing MAKE_TYPED_ARRAY_INFO for Packed*Arrays 2024-08-22 21:02:48 -07:00
David Snopek 19c83a8837
Merge pull request #1554 from raulsntos/char-metadata
Correct type for `char16` and `char32` meta
2024-08-22 19:17:59 -05:00
Raul Santos 9a89d226c7
Correct type for `char16` and `char32` meta 2024-08-23 00:33:11 +02:00
David Snopek 265412cc53
Merge pull request #1557 from mihe/cpp-operators
Fix incorrect generation of some C++ operators
2024-08-22 16:45:18 -05:00
David Snopek 92ace04989 Add a test to ensure that library path is absolute 2024-08-22 16:31:35 -05:00
David Snopek 62305943a7
Merge pull request #1555 from raulsntos/fix-r1722784216
Avoid hardcoded type conversion for metadata
2024-08-22 16:30:17 -05:00
Mikael Hermansson 9949d09f3e Fix incorrect generation of some C++ operators 2024-08-21 20:37:52 +02:00
David Snopek 8b80d9146b
Merge pull request #1528 from AThousandShips/style_fix_2
Make generated code mostly style compliant
2024-08-21 07:12:59 -05:00
Raul Santos 4829199081
Avoid hardcoded type conversion for metadata
The engine uses the names `int` and `float` to refer to the 64-bit types, so in the bindings generator we have a hardcoded conversion for those types.

But this type conversion should not be used for metadata. Even though the underlying type should still be 64-bit for interop, metadata is meant to specify the correct type to expose. So if metadata says `float` it means the type is really meant to be a 32-bit `float` and not `double`. Other hardcoded type conversions (`int` and `Nil`) won't ever be metadata.

This change corrects the `float` type, to use the right type in the generated C++ code. Before we were always using `double` due to this type conversion.
2024-08-20 14:53:22 +02:00
David Snopek fbbf9ec4ef
Merge pull request #1550 from Naros/sync-4.3-stable
gdextension: Sync with upstream commit 77dcf97d82cbfe4e4615475fa52ca03da645dbd8 (4.3-stable)
2024-08-15 06:27:31 -05:00
Chris Cranford 2e4c350b83 gdextension: Sync with upstream commit 77dcf97d82cbfe4e4615475fa52ca03da645dbd8 (4.3-stable) 2024-08-15 05:53:22 -04:00
bruvzg f2353da5a3 Add support for LLVM/MinGW and ARM64 Windows builds. 2024-08-12 08:53:40 +03:00
David Snopek 9b98377a62
Merge pull request #1546 from aaronfranke/fix-vec4arr
Fix missing type info for PackedVector4Array
2024-08-11 06:19:28 -05:00
Aaron Franke 92e6ea7303
Fix missing type info for PackedVector4Array 2024-08-10 21:21:13 -07:00
David Snopek 11773e52b0 gdextension: Sync with upstream commit 03afb92efa18874da19f7fc185a32c005d20aa1d (4.3-rc3) 2024-08-09 08:44:03 -05:00
David Snopek 937b1d809a
Merge pull request #1545 from Klaim/warnings_gdclass
Removes warnings generated by GDCLASS usage
2024-08-08 09:13:51 -05:00
Klaim (Joël Lamotte) 738859f49b removes warnings generated by GDCLASS usage
This change removes the warnings (unused parameters) coming from code injected by the GDCLASS macro.
Contrary to warnings coming from the normal source code which can be suppressed with most compiles by specifying the include directories of this library as external or system,
when the code is injected through a macro it is considered in the context of the user, which is the source code of user of the library.
That forces the users to modify their code to hide the warnings coming from the mandatory `GDCLASS` here.
That's why it's important to remove these warning from that specific macro and ideally any other macro that the user must use.
2024-08-08 02:46:28 +02:00
David Snopek 9da1e0cee1
Merge pull request #1543 from Calinou/readme-use-github-admonition-syntax
Use GitHub admonition syntax for the warning in README
2024-08-07 15:54:36 -05:00
David Snopek 3f4590f8e1
Merge pull request #1539 from Naros/dispatch-get-set-up-hierarchy
Make sure `_get` and `_set` dispatch up the class hierarchy
2024-08-07 15:53:54 -05:00
David Snopek e3e8101e8c
Merge pull request #1330 from pimms/cmake-hot-reload
Add hot reload support to CMakeLists.txt
2024-08-07 15:53:35 -05:00
Hugo Locurcio 26459dc47b
Use GitHub admonition syntax for the warning in README 2024-08-05 19:31:32 +02:00
David Snopek daf6ad3649 gdextension: Sync with upstream commit 3978628c6cc1227250fc6ed45c8d854d24c30c30 (4.3-rc2) 2024-08-02 09:39:49 -05:00
Chris Cranford c77d44f3f6 Make sure `_get` and `_set` dispatch up the class hierarchy 2024-08-01 12:03:27 -04:00
David Snopek f2b521f55a
Merge pull request #1530 from akien-mga/py-two-old
SCons: Remove old Python 2 compat code
2024-07-24 09:06:01 -05:00
David Snopek 628606b28b
Merge pull request #1519 from AThousandShips/cache_improve
[CI] Upload build cache before running tests
2024-07-24 09:05:48 -05:00
Rémi Verschelde 958776dfc3
SCons: Remove old Python 2 compat code 2024-07-18 10:37:47 +02:00
A Thousand Ships f131efb791
Make generated code mostly style compliant 2024-07-17 17:29:31 +02:00
David Snopek 0a1e31fa45
Merge pull request #1513 from dsnopek/unexpose-is-instance-valid
Unexpose `UtilityFunctions::is_instance_valid()`
2024-07-15 12:16:21 -05:00