CMake: XCode dependency chain fixes - remastered

When attempting to generate XCode projects it would fail due to the target dependency chain not meeting expectations.

This PR, adds the required dependency infomation so that the XCode generator works.
This commit is contained in:
Samuel Nicholas
2025-03-11 12:33:38 +10:30
parent 6f981b33cc
commit f83f364144
3 changed files with 12 additions and 21 deletions

View File

@@ -271,9 +271,6 @@ function(godotcpp_generate)
"${CMAKE_CURRENT_BINARY_DIR}"
)
add_custom_target(godot-cpp.generate_bindings DEPENDS ${GENERATED_FILES_LIST})
set_target_properties(godot-cpp.generate_bindings PROPERTIES FOLDER "godot-cpp")
### Platform is derived from the toolchain target
# See GeneratorExpressions PLATFORM_ID and CMAKE_SYSTEM_NAME
string(
@@ -332,6 +329,9 @@ function(godotcpp_generate)
# the godot-cpp.* library targets
add_library(godot-cpp STATIC)
# Without adding this dependency to the binding generator, XCode will complain.
add_dependencies(godot-cpp generate_bindings)
# Added for backwards compatibility with prior cmake solution so that builds dont immediately break
# from a missing target.
add_library(godot::cpp ALIAS godot-cpp)