Commit Graph

1695 Commits

Author SHA1 Message Date
David Snopek
a3f89217df Merge pull request #1723 from enetheru/comments
CMake: Comment Cleanup
2025-03-06 08:21:53 -06:00
David Snopek
55cbea7435 Merge pull request #1728 from enetheru/default_target
CMake: template_debug as default target when godot-cpp is top level
2025-03-06 08:21:29 -06:00
Samuel Nicholas
8b33e73353 CMake: default target when godot-cpp is top level
People seem to want to build godot-cpp without any arguments, not even specifying a target.

We have to detect if we are top level though because it conflicts with being consumed.
2025-03-07 00:04:36 +10:30
Samuel Nicholas
671e309cfa Updating commenting to be consistent 2025-03-06 23:57:02 +10:30
David Snopek
05f5d73876 Merge pull request #1722 from enetheru/gersemi
CMake: Pre-Commit Hook to Gersemi for auto-formatting
2025-03-06 06:42:51 -06:00
Samuel Nicholas
2f6d7f2dad add gersemi to pre-commit hooks for CMake formatting like black 2025-03-04 13:58:39 +10:30
David Snopek
714c9e2c16 gdextension: Sync with upstream commit 4c311cbee68c0b66ff8ebb8b0defdd9979dd2a41 (4.4-stable) godot-4.4-stable 2025-03-03 09:30:17 -06:00
David Snopek
06082d7727 Merge pull request #1721 from enetheru/godotcpp
CMake: Rename all GODOT_ to GODOTCPP_
2025-03-01 10:49:38 -06:00
David Snopek
26358b5e3a Merge pull request #1719 from dsnopek/gdvirtual-required-macros
Update `GDVIRTUAL*()` macros to match Godot 4.4
2025-03-01 08:21:53 -06:00
David Snopek
e3816585fe gdextension: Sync with upstream commit 15ff450680a40391aabbffde0a57ead2cd84db56 (4.4-rc3) 2025-02-28 19:24:25 -06:00
Samuel Nicholas
d0dd282d73 CMake: Rename all GODOT_ to GODOTCPP_
This is for discussion primarily at this stage.
2025-03-01 10:50:55 +10:30
David Snopek
0a73df5f53 Check that precision of extension_api.json matches build options 2025-02-27 13:27:11 -06:00
David Snopek
c8c25cd312 Merge pull request #1720 from enetheru/generator_target
CMake: Add generate_bindings custom target
2025-02-27 12:57:35 -06:00
David Snopek
4a9409a30f Update GDVIRTUAL*() macros to match Godot 4.4 2025-02-26 12:56:55 -06:00
David Snopek
375c0d1575 gdextension: Sync with upstream commit 01545c995b0612c68f9dfce8f6cc67576c298381 (4.4-rc2) 2025-02-26 07:51:29 -06:00
Samuel Nicholas
e7f07dab87 CMake: Add generate_bindings custom target
I was working on something today and wanted to just generate the bindings separately to compilation.

This PR adds a custom target to do just that.
2025-02-26 23:02:59 +10:30
David Snopek
98ea2f60bb gdextension: Sync with upstream commit 8ed125b42908d0d46d3b8967e3a3bc03f809b3af (4.4-rc1) 2025-02-24 10:35:53 -06:00
David Snopek
48baa0c812 Merge pull request #1713 from Repiteo/style/nodiscard
Style: Replace `_NO_DISCARD_` macro with `[[nodiscard]]`
2025-02-21 14:32:36 -06:00
Thaddeus Crews
89fd27608f Style: Replace _NO_DISCARD_ macro with [[nodiscard]] 2025-02-20 09:23:08 -06:00
David Snopek
5eb6e6bf61 Merge pull request #1709 from enetheru/MinGWMakefiles
CMake: Create destination folder for doc_source.cpp generation
2025-02-17 15:26:44 -06:00
Samuel Nicholas
23c24073f4 CMake: Create destination folder for doc_source.cpp generation
When compiling using 'MinGW Makefiles' the folders aren't created automatically.
2025-02-18 07:11:53 +10:30
David Snopek
79f9bc9600 Merge pull request #1708 from enetheru/arch_confusion
CMake: Fix unknown architecture and simplify OSX_ARCHITECTURES
2025-02-17 11:04:34 -06:00
David Snopek
3f54a86554 Merge pull request #1707 from enetheru/cmake_module
CMake: GodotCPPModule.cmake
2025-02-17 11:04:25 -06:00
David Snopek
847dca4792 Merge pull request #1701 from enetheru/msvc_runtime
CMake: Fix for #1699 msvc runtime selection issues
2025-02-17 11:04:15 -06:00
Samuel Nicholas
18a926e836 CMake: Fix for #1699 msvc runtime selection issues
Previously I eschewed the use of CMAKE_MSVC_RUNTIME_LIBRARY in favour of setting the flags using target_compile_options so that they would propagate to consumers.

However, it has been raised that a dependency( independent to godot-cpp ) that doesn't set any runtime flags, which relies purely on the CMAKE_MSVC_RUNTIME_LIBRARY variable will very likely not have the correct msvc runtime flags set.

Where MSVC documentation states "All modules passed to a given invocation of the linker must have been compiled with the same runtime library compiler option (/MD, /MT, /LD)."

It was also mentioned that message type WARNING is not ideal for notifying consumers.

So I have updated the cmake code to use CMAKE_MSVC_RUNTIME_LIBRARY  over target-compile_options. And set it as a CACHE STRING variable so that it can be overridden if desired. We still message consumers, but as a NOTICE.
2025-02-15 18:28:12 +10:30
Samuel Nicholas
35469fd839 Turn python_callouts.cmake into GodotCPPModule.cmake
Move the find_package for python into it.
Recommend adding godot-cpp/cmake to CMAKE_MODULE_PATH and using include( GodotCPPModule ) to use functions.
Add target_doc_sources function to simplify the addition of documentation to a binary.
2025-02-15 09:04:12 +10:30
Ben Lubar
a353be57d8 Fix -Wmissing-braces warning (included in -Wall) in array constructor for generated function call bindings 2025-02-09 17:20:06 -06:00
Samuel Nicholas
9d9099adcd Simplified architecture naming to reduce confusion 2025-02-09 18:08:53 +10:30
David Snopek
f398ebb8ce gdextension: Sync with upstream commit 06acfccf89ad6b900ae694a4d58ceade1967a85f (4.4-beta3) 2025-02-08 15:02:31 -06:00
David Snopek
560f786599 Merge pull request #1698 from enetheru/threads
CMake: Implement 'threads' Option
2025-02-07 12:07:33 -06:00
Samuel Nicholas
91f81f51e1 CMake: Implement 'threads' Option
Add the GODOT_THREADS option and related supporting code
Includes naming cleanups
2025-02-04 09:08:35 +10:30
David Snopek
ee2a895ea4 Merge pull request #1335 from godotengine/dependabot/github_actions/actions/upload-artifact-4
Bump actions/upload-artifact from 3 to 4
2025-02-03 11:18:23 -06:00
David Snopek
f06af65c87 gdextension: Sync with upstream commit a013481b0911e59cc3f3dea7ebb732450c3e1460 (4.4-beta2) 2025-02-02 08:41:18 -06:00
David Snopek
3c55ca7a14 Merge pull request #1691 from enetheru/fix1690
CMake: Fix #1690 - DEBUG_FEATURES generator expression
2025-01-29 11:14:51 -06:00
Samuel Nicholas
9ce7a71cbf CMake: Fix #1690 - DEBUG_FEATURES generator expression
As described in issue #1690 the expression needs to depend on TARGET_ALIAS not TARGET_NAME.

This was introduced when I was solving the naming conflict issues and I missed this usage.
2025-01-23 14:36:48 +10:30
David Snopek
13cd2d921c Merge pull request #1628 from IvanInventor/typed_dict_regression_fix
fix typed_dictionary compile-time regression
2025-01-21 11:15:42 -06:00
David Snopek
b86cf321d0 Merge pull request #1687 from bgie/enum_size
Fix buffer overrun with enums pointers cast to int64_t* when enum is only 32-bit
2025-01-21 06:28:58 -06:00
David Snopek
faf6facffc Merge pull request #1686 from bgie/readme_precommit
Update README.md with new pre-commit instructions
2025-01-21 06:27:40 -06:00
David Snopek
dfc51960f9 gdextension: Sync with upstream commit d33da79d3f8fe84be2521d25b9ba8e440cf25a88 (4.4-beta1) 2025-01-20 15:23:58 -06:00
Brecht Kuppens
7576dc5930 Fix buffer overrun with enums pointers cast to int64_t* when enum is only 32-bit 2025-01-20 10:29:16 +01:00
Brecht Kuppens
bd3cf478c6 Update README.md with new pre-commit instructions 2025-01-20 09:25:59 +01:00
David Snopek
befe3ee2f2 Merge pull request #1682 from enetheru/gdext-docs-cmake
CMake: Support for XML documentation
2025-01-13 09:06:59 -06:00
Samuel Nicholas
8814ac51ac CMake: Support for XML documentation
Add new function generate_doc_source to python_callouts.cmake
Update Test extension to use generate_doc_source function and include generated file in the build.

Cleanup:
Fix godotcpp.py imports after rebase
Pre-Commit hook sorted python imports in doc_source_generator.py
- replace ${CMAKE_CURRENT_SOURCE_DIR} with ${godot-cpp_SOURCE_DIR} when referencing current working directory and script locations when invoking python scripts.

Co-authored-by: David Snopek <dsnopek@gmail.com>
2025-01-13 08:28:42 +10:30
Cedric Shock
1345c46650 Add SCons variant_dir support, which allows specifying a target build directory. 2025-01-12 18:32:59 +01:00
David Snopek
94a1f4f2fb Merge pull request #1670 from enetheru/build_profile
CMake: Support for using build_profile.json
2025-01-12 05:29:29 -06:00
David Snopek
65046d00a5 Merge pull request #1676 from dsnopek/gdextension-virtual-method-compat
Update for virtual method compatibility system
2025-01-12 05:28:38 -06:00
David Snopek
5c9529fc84 Update for virtual method compatibility system 2025-01-11 16:36:59 -06:00
Samuel Nicholas
ae198fe860 CMake: Support using build_profile.json
Add python_callouts.py to hold functions which call python utilities
- generate trimmed API
- generate file list
- generate bindings

if GODOT_BUILD_PROFILE is specified, a trimmed API file is created in the CMAKE_CURRENT_BINARY_DIR and used as the source for binding generation

Simplify Code Generation Variables
- use generator expressions
- use math for bits
- simplify if statements
2025-01-11 12:22:22 +10:30
David Snopek
012b8ffc3a Merge pull request #1658 from enetheru/name_clash
CMake: Alleviate target name clashes, visibility, and grouping.
2025-01-10 09:05:54 -06:00
David Snopek
7d3870bc87 Merge pull request #1680 from Faless/build/profile_strip_json
[Bindings] Build profile now strips methods and skip files
2025-01-07 14:42:20 -06:00