8 Commits

Author SHA1 Message Date
David Snopek
a64f264337 On Linux default use_static_cpp to disabled
(cherry picked from commit d033e8abea)
2025-11-30 06:30:40 -06:00
Lukas Tenbrink
c1b2eb0d5a Migrate cmake docs to the godot docs.
(cherry picked from commit c7873e1355)
2025-10-20 13:30:07 -05:00
unvermuthet
863f94de77 Implement use_static_cpp flag for Linux
(cherry picked from commit b0f41909e0)
2025-06-24 15:32:45 -05:00
Samuel Nicholas
368ec63a24 CMake: Target as configuration option
Add GODOTCPP_TARGET configuration option
Remove loop to generate the godot-cpp.<target> CMake Targets

Rename test bindings target
Update documentation

(cherry picked from commit 89abe15268)
2025-03-17 11:26:56 -05:00
Samuel Nicholas
4b5d800596 Updating commenting to be consistent
(cherry picked from commit 671e309cfa)
2025-03-17 11:26:21 -05:00
Samuel Nicholas
8bdf9b82a2 add gersemi to pre-commit hooks for CMake formatting like black
(cherry picked from commit 2f6d7f2dad)
2025-03-17 11:26:12 -05:00
Samuel Nicholas
6f7293cef4 Alleviate CMake target name clashes, visibility, and grouping.
Simplify <platform>_generate cmake function signature, as TARGET_ALIAS and TARGET_NAME are still in scope and do not need to be passed.
Add USE_FOLDERS, and FOLDER properties to group targets in VS and XCode
Guard test target with GODOT_ENABLE_TESTING
Generate all three variants in the form godot-cpp.test.<target> to remove the -DTEST_TARGET option clutter.
Update the docs/cmake.rst with information about the testing target
Update the Github CI
2024-12-29 09:54:55 +10:30
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