Commit Graph

1525 Commits (732df06a8145a8912b1e5afd26d68d36be756f00)

Author SHA1 Message Date
Samuel Nicholas 732df06a81 CMake: Fix selection of MSVC Runtime compile flags
My last attempt at solving this was not correct. I have left lots of comments in the source detailing the issue as it will effect consumers.
2024-12-05 09:15:40 +10:30
David Snopek bb567060f4
Merge pull request #1616 from dsnopek/ptrtoarg-no-error-for-null-ref
Don't print an error when decoding a null Ref<T>
2024-12-02 12:54:26 -06:00
David Snopek 5255034fb0
Merge pull request #1653 from aaronfranke/print
Add `print_line` for compatibility with engine modules
2024-11-28 07:31:06 -06:00
David Snopek b378d8c21f
Merge pull request #1654 from Ivorforce/gdextension-interface-update
Update gdextension_interface.h. Add metadata to GetTypeInfo of char16_t and char32_t.
2024-11-28 06:59:21 -06:00
David Snopek af4eaa76d7
Merge pull request #1649 from enetheru/fix-backward-break
CMake: fix break for build prior to modernisation PR
2024-11-28 06:58:57 -06:00
David Snopek 3a8d7a25ae
Merge pull request #1647 from enetheru/fix#1459
CMake: Align MSVC runtime (MD[d], MT) options to engine
2024-11-28 06:57:53 -06:00
David Snopek bc6f79c67a
Merge pull request #1617 from zhehangd/fix_def_hpp_namespace
Use namespace in defs.hpp
2024-11-28 06:57:20 -06:00
Samuel Nicholas b7dbd26d8f Align MSVC runtime (MD[d], MT) options to engine #1647
Engine has an option to link to MDd debug_crt
add flag to SCons options
Add flag to CMAKE options
2024-11-28 13:46:41 +10:30
Lukas Tenbrink f174b4a445 Update gdextension_interface.h. Add metadata to GetTypeInfo of char16_t and char32_t. 2024-11-26 21:43:59 +01:00
Aaron Franke ac466e4766
Add `print_line` for compatibility with engine modules 2024-11-26 03:06:22 -08:00
Samuel Nicholas 597055d13c CMake: re-add the godot::cpp alias pointing to template_debug
So that builds that relied on the alias already wont break.
2024-11-26 19:42:33 +10:30
David Snopek a42b3634d2
Merge pull request #1598 from enetheru/modernise
Modernise existing cmake options
2024-11-22 08:23:46 -06:00
Samuel Nicholas 8534e2104f Modernise Existing CMakeLists.txt
- Added to .gitignore CMakeUserPresets.json

### Configuration:
- Changed python command to use single quotes to make build output log more legible.
- Added GODOT_DEV_BUILD to allow differentiation of debug or Release builds.
- Added find logic for macos Cocoa library

### godot-cpp Changes
- godot-cpp-test is changed to be incorporated into the cmake build as a target.
- Duplicated godot-cpp target into [template_release, template_debug, editor]
- Created {platform}.cmake files mirroring the style of the SCons build.

CMake has a feature called generator expressions for its configuration variables that are evaluated at build time. This allows multi-configuration build systems to properly evaulate options. for msvc, xcode and nijna multi-config.

- Moved configuration options to generator expressions with the notable exclusion of OSX_ARCHITECTURES.
- Remove CMAKE_BUILD_TYPE from msvc CI target as Multi-Config generators ignore it

### godot-cpp-test Changes
- Removed majority of the cmake code, now that the godot-cpp project is setup, the majority of the flags will be propagated as transient dependencies
- Marked with EXCLUDE_FROM_ALL so that it isn't built as part of the 'all' target
- Updated ci to build the godot-cpp-test target from the root directory using cmake
- Tests passing for Windows, Linux, and Macos builds.

### Documentation
Updated with new information
Added Emscripten example
Added Android example
2024-11-21 11:01:00 +10:30
David Snopek c20a84e483
Merge pull request #1601 from Ivorforce/lto
Add lto scons option
2024-11-12 11:16:10 -06:00
Lukas Tenbrink 5f7cf05043 Add lto scons option, defaulting to "none". 2024-11-12 12:45:35 +01:00
David Snopek f298ddd3c4
Merge pull request #1639 from AThousandShips/emsdk_cache_fix
[Web] Don't cache emsdk
2024-11-11 10:30:47 -06:00
A Thousand Ships 1e3b24f658
[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
2024-11-09 16:21:59 +01:00
David Snopek 253e095c81
Merge pull request #1581 from dsnopek/classdb-add-virtual-method-arg-metadata-size
Fix crash in `ClassDB::add_virtual_method()` if arguments metadata is the wrong size
2024-11-05 09:18:01 -06:00
Zhehang Ding 450c3d65cd Use namespace in defs.hpp
A global alias of godot::real_t is defined for backward compatibility
2024-11-03 15:13:37 +08:00
David Snopek 259c757cce
Merge pull request #1609 from Ivorforce/patch-3
Rename Vector4.components -> coords.
2024-10-30 14:51:04 -05:00
Lukas Tenbrink 23c9d41d2a Rename Vector4.components -> coords.
The use of .components is deprecated.
2024-10-30 15:44:44 +01:00
David Snopek 7871cec1e7
Merge pull request #1568 from dsnopek/post-initialize-44
Update for new NOTIFICATION_POSTINITIALIZE handling
2024-10-30 08:49:59 -05:00
David Snopek 688ed4b388
Merge pull request #1626 from ruffenman/remove-unimplemented-variant-functions
Remove unimplemented static variant functions 'blend' and 'interpolate'…
2024-10-30 08:49:38 -05:00
David Snopek 7796fcc890
Merge pull request #1622 from Repiteo/ci/runner
CI: Add `runner` workflow to call other workflows
2024-10-30 08:48:37 -05:00
David Snopek 42e398e4e2 Update for new NOTIFICATION_POSTINITIALIZE handling 2024-10-29 16:29:24 -05:00
David Snopek ca5179f7d7
Merge pull request #1594 from dsnopek/macos-thread-local
Avoid `thread_local` on MacOS to prevent issues with hot reload
2024-10-29 15:39:49 -05:00
David Snopek 1e169bb809 Fix crash in `ClassDB::add_virtual_method()` if arguments metadata is the wrong size 2024-10-29 13:22:12 -05:00
David Snopek fa3dfa0e3c
Merge pull request #1591 from dsnopek/variant-object-instance-id
Directly get object instance ID from `Variant` and implement `Variant::get_validated_object()`
2024-10-29 13:10:12 -05:00
David Snopek 7fca545885
Merge pull request #1574 from dsnopek/unicode-class-names
Allow unicode class names
2024-10-29 13:09:45 -05:00
David Snopek dfdc047459
Merge pull request #1630 from dsnopek/sync-quaternion
Sync `Quaternion` with the version in Godot
2024-10-29 08:36:28 -05:00
David Snopek 2004af63a0 Sync `Quaternion` with the version in Godot 2024-10-28 15:37:45 -05:00
David Snopek 0602c32986 Directly get object instance ID from `Variant` and implement `Variant::get_validated_object()` 2024-10-17 09:58:52 -05:00
David Snopek 91833c852e Avoid `thread_local` on MacOS to prevent issues with hot reload 2024-10-17 09:06:27 -05:00
David Snopek a98d41f62b
Merge pull request #1590 from dsnopek/reload-instance-bindings
Correctly set instance bindings on reload
2024-10-17 16:05:02 +02:00
David Snopek 96675a814b
Merge pull request #1625 from Flarkk/looking_at
Add `p_use_model_front` to `Basis::looking_at()`
2024-10-17 16:02:02 +02:00
David Snopek 291147e21b
Merge pull request #1611 from Repiteo/library-no-cache
SCons: Don't cache libraries
2024-10-15 14:42:20 +02:00
ruffenman 42a35a1852 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. 2024-10-14 20:33:20 -04:00
Florent Guiocheau 02fd535454 Add p_use_model_front to Basis::looking_at() 2024-10-14 21:50:12 +02:00
Thaddeus Crews c1524f7c86
CI: Add `runner` workflow to call other workflows 2024-10-11 10:58:28 -05:00
David Snopek 7f02301a91 Don't print an error when decoding a null Ref<T> 2024-10-07 11:22:52 -05:00
David Snopek 6facde3c29
Merge pull request #1602 from Faless/build/use_clang_cl_is_use_llvm
[SCons] Remove use_clang_cl windows flag in favor of generic use_llvm
2024-10-03 08:35:35 -05:00
David Snopek 709bad01d1
Merge pull request #1595 from enetheru/restructure
Re-Structure cmake solution to be closer to the scons solution.
2024-10-03 08:34:54 -05:00
Thaddeus Crews 83c0f15ab9
SCons: Don't cache librarys 2024-09-30 11:26:06 -05:00
David Snopek 96565e1de5
Merge pull request #1600 from enetheru/vsproj-ci-config
VSProj Configure type on build command - to resolve #1582
2024-09-26 06:03:56 -07:00
David Snopek 78f5d99fd9
Merge pull request #1599 from enetheru/gitignore
Update .gitignore to add .idea for the Jetbrains CLion IDE
2024-09-24 05:37:41 -05:00
Samuel Nicholas 9f5daa2d90 update .gitignore to add .idea for the Jetbrains CLion IDE
and also the default cmake build directory when building in clion cmake-build-*
2024-09-24 16:28:58 +09:30
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
Fabio Alessandrelli 4717a78144 [SCons] Remove use_clang_cl windows flag in favor of generic use_llvm
This is consistent with Godot upstream.
2024-09-22 13:39:06 +02:00