Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-868 Bump godot-engine/godot-cpp to 4.4.beta2 #875

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 22 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,21 @@ ENDIF ()

# Setup the CMAKE_MODULE_PATH
LIST(APPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/"
"${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-cpp/cmake/")
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/")

# Include and execute various CMAKE modules
INCLUDE(generate-authors)
INCLUDE(generate-license)
INCLUDE(generate-version)
INCLUDE(generate-donors)
INCLUDE(godot-extension-db-generator)
INCLUDE(godot-docs-generator)

# Generation steps
GENERATE_AUTHORS()
GENERATE_LICENSE()
GENERATE_VERSION()
GENERATE_DONORS()
GENERATE_GODOT_EXTENSION_DB()
GENERATE_GODOT_DOCUMENTATION()

# Configure project
PROJECT("${GDEXTENSION_LIB_NAME}" LANGUAGES C CXX VERSION ${RESOLVED_VERSION})
Expand All @@ -83,9 +80,6 @@ IF (WIN32)
CONFIGURE_FILE(cmake/templates/windows.rc.in ${CMAKE_CURRENT_BINARY_DIR}/_generated/version.rc @ONLY)
ENDIF ()

# Orchestrator is an editor plug-in, force TOOLS_ENABLED
ADD_COMPILE_DEFINITIONS(TOOLS_ENABLED)

# MacOS universal binary support
IF (APPLE)
SET(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Build architectures for OSX" FORCE)
Expand All @@ -99,22 +93,25 @@ SET(compiler_is_msvc "$<CXX_COMPILER_ID:MSVC>")
# Configure godot-cpp - a statically linked library to this project.
INCLUDE(godot-dev-configuration)

# Generate Doc Data
file( GLOB_RECURSE DOC_XML LIST_DIRECTORIES NO CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/doc_classes/*.xml" )
SET(DOC_DATA_CPP_FILE "${CMAKE_BINARY_DIR}/_generated/doc_data.cpp")
generate_doc_source( "${DOC_DATA_CPP_FILE}" "${DOC_XML}" )

# Library sources
FILE(GLOB_RECURSE gdext_sources
CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.[hc]"
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.[hc]pp"
# Includes the generated doc data from /doc_classes
"${CMAKE_BINARY_DIR}/_generated/*.cpp"
"${DOC_DATA_CPP_FILE}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured out that this is the reason the doc_source_generator isnt working, this GLOB pattern doent find the file since it hasnt been generated yet.

The custom command to generate the sources relies on the result being added to a target, and since only the results from the GLOB are added(missing the doc_source.cpp) the dependency chain to generate the file doesnt exist.

Moving the "${DOC_DATA_CPP_FILE}" down to the add_library as an explicit file dependency will solve it.

# Include windows version resource, if exists
"${CMAKE_CURRENT_BINARY_DIR}/_generated/version.rc")

# GDExtension library
ADD_LIBRARY(${PROJECT_NAME} SHARED ${gdext_sources})

## Import compiler warnings from godot-cpp
INCLUDE(GodotCompilerWarnings)

# Setup compiler options for GDExtension Library based on the compiler used
TARGET_COMPILE_OPTIONS(${PROJECT_NAME} PUBLIC
$<${compiler_is_msvc}:
Expand All @@ -126,7 +123,7 @@ TARGET_COMPILE_OPTIONS(${PROJECT_NAME} PUBLIC
/MDd
>
$<$<CONFIG:Release>:
/MD
/MT
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The godot-cpp defines the msvc runtime flags as public, so will propogate them to consumers, there shouldnt be a need to set them manually like this.

infact, it currently has all flags as public which is something I want to change, but the msvc runtime ones will remain public.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, I see the logic for this in windows.cmake, thanks for the reference.

/O2
>
>
Expand Down Expand Up @@ -180,26 +177,23 @@ IF (AUTOFORMAT_SRC_ON_CONFIGURE MATCHES ON)
ENDIF ()

# Dependency linking
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC godot::cpp)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC godot-cpp.editor)

SET(GDEXTENSION_LIB_PREFIX "")

IF (NOT ANDROID)
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(system_bits 64)
ELSE ()
SET(system_bits 32)
ENDIF ()
ELSE ()
SET(GDEXTENSION_LIB_PREFIX "lib")
IF (CMAKE_ANDROID_ARCH STREQUAL "arm64")
SET(system_bits 64)
ELSE ()
SET(system_bits 32)
ENDIF ()
ENDIF ()
### Get useful properties of the library
get_target_property( GODOT_PLATFORM godot-cpp::editor GODOT_PLATFORM )
get_target_property( GODOT_TARGET godot-cpp::editor GODOT_TARGET )
get_target_property( GODOT_ARCH godot-cpp::editor GODOT_ARCH )

# Converts GODOT_ARCH to the old system bits for unchanged file names.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about this trick?

math( EXPR ORCHESTRATOR_ARCH "${CMAKE_SIZEOF_VOID_P} * 8" ) # CMAKE_SIZEOF_VOID_P refers to target architecture.

IF (GODOT_ARCH STREQUAL "x86_64")
SET(ORCHESTRATOR_ARCH "64")
ELSE()
SET(ORCHESTRATOR_ARCH "32")
ENDIF()

STRING(TOLOWER "${PROJECT_NAME}.${CMAKE_SYSTEM_NAME}.${system_bits}.${CMAKE_BUILD_TYPE}" GDEXTENSION_LIB_NAME)
# STRING(TOLOWER ${PROJECT_NAME}.${GODOT_PLATFORM}.${ORCHESTRATOR_ARCH}.$<LOWER_CASE:$<CONFIG>> GDEXTENSION_LIB_NAME)

SET_TARGET_PROPERTIES(${PROJECT_NAME}
PROPERTIES
Expand All @@ -212,7 +206,7 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME}
RUNTIME_OUTPUT_DIRECTORY "${GDEXTENSION_LIB_PATH}"
CMAKE_PDB_OUTPUT_DIRECTORY "${GDEXTENSION_LIB_PATH}"
CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY "${GDEXTENSION_LIB_PATH}"
OUTPUT_NAME "${GDEXTENSION_LIB_NAME}")
OUTPUT_NAME "${PROJECT_NAME}.${GODOT_PLATFORM}.${ORCHESTRATOR_ARCH}.$<LOWER_CASE:$<CONFIG>>")

INCLUDE(cmake-utils)

Expand Down
2 changes: 1 addition & 1 deletion cmake/cmake-utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ FUNCTION( PRINT_PROJECT_VARIABLES )
MESSAGE( NOTICE " CMAKE_MINIMUM_REQUIRED_VERSION:..........: " ${CMAKE_MINIMUM_REQUIRED_VERSION} )
MESSAGE( NOTICE " VCPKG_TARGET_TRIPLET.....................: " ${VCPKG_TARGET_TRIPLET} )
MESSAGE( NOTICE " CMAKE_DEBUG_POSTFIX......................: " ${CMAKE_DEBUG_POSTFIX} )
MESSAGE( NOTICE " system_bits..............................: " ${system_bits} )
MESSAGE( NOTICE " ORCHESTRATOR_ARCH........................: " ${ORCHESTRATOR_ARCH} )
MESSAGE( NOTICE " GDEXTENSION_LIB_NAME.....................: " ${GDEXTENSION_LIB_NAME} )
MESSAGE( NOTICE " RESOLVED_VERSION.........................: " ${RESOLVED_VERSION} )
MESSAGE( NOTICE " GIT_COMMIT_HASH..........................: " ${GIT_COMMIT_HASH} )
Expand Down
2 changes: 2 additions & 0 deletions cmake/godot-dev-configuration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ ENDIF ()
# Godot C++ bindings library setup/configuration
# =======================================================================

# SET( GODOT_BUILD_PROFILE "${CMAKE_SOURCE_DIR}/extern/godot-cpp-profile.json" )

ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-cpp )

# =======================================================================
Expand Down
2 changes: 1 addition & 1 deletion extern/godot-cpp
Submodule godot-cpp updated 65 files
+14 −11 .github/actions/godot-cache-restore/action.yml
+6 −5 .github/actions/godot-cache-save/action.yml
+62 −0 .github/actions/setup-godot-cpp/action.yml
+27 −77 .github/workflows/ci.yml
+21 −0 .github/workflows/runner.yml
+7 −2 .github/workflows/static_checks.yml
+7 −0 .gitignore
+52 −215 CMakeLists.txt
+1 −2 README.md
+245 −206 binding_generator.py
+183 −0 build_profile.py
+0 −94 cmake/GodotCompilerWarnings.cmake
+40 −0 cmake/android.cmake
+175 −0 cmake/common_compiler_flags.cmake
+40 −0 cmake/emsdkHack.cmake
+347 −0 cmake/godotcpp.cmake
+21 −0 cmake/ios.cmake
+21 −0 cmake/linux.cmake
+59 −0 cmake/macos.cmake
+127 −0 cmake/python_callouts.cmake
+41 −0 cmake/web.cmake
+100 −0 cmake/windows.cmake
+377 −0 doc/cmake.rst
+55 −0 doc_source_generator.py
+43,195 −23,995 gdextension/extension_api.json
+133 −12 gdextension/gdextension_interface.h
+6 −2 include/godot_cpp/classes/ref.hpp
+22 −18 include/godot_cpp/classes/wrapped.hpp
+24 −12 include/godot_cpp/core/class_db.hpp
+8 −0 include/godot_cpp/core/defs.hpp
+73 −0 include/godot_cpp/core/print_string.hpp
+12 −11 include/godot_cpp/core/type_info.hpp
+5 −2 include/godot_cpp/godot.hpp
+1 −1 include/godot_cpp/templates/safe_refcount.hpp
+1 −1 include/godot_cpp/variant/basis.hpp
+42 −44 include/godot_cpp/variant/quaternion.hpp
+439 −0 include/godot_cpp/variant/typed_dictionary.hpp
+3 −2 include/godot_cpp/variant/variant.hpp
+509 −0 include/godot_cpp/variant/variant_internal.hpp
+4 −3 include/godot_cpp/variant/vector4.hpp
+31 −17 misc/scripts/check_get_file_list.py
+25 −23 src/classes/wrapped.cpp
+15 −7 src/core/class_db.cpp
+39 −0 src/core/print_string.cpp
+10 −4 src/godot.cpp
+5 −2 src/variant/basis.cpp
+6 −0 src/variant/packed_arrays.cpp
+28 −40 src/variant/quaternion.cpp
+7 −6 src/variant/variant.cpp
+43 −0 src/variant/variant_internal.cpp
+94 −143 test/CMakeLists.txt
+1 −0 test/SConstruct
+5 −1 test/build_profile.json
+24 −2 test/project/main.gd
+65 −0 test/src/example.cpp
+20 −0 test/src/example.h
+1 −0 test/src/register_types.cpp
+5 −0 tools/android.py
+31 −1 tools/common_compiler_flags.py
+44 −47 tools/godotcpp.py
+5 −0 tools/ios.py
+4 −0 tools/linux.py
+5 −0 tools/macos.py
+9 −1 tools/web.py
+64 −12 tools/windows.py
2 changes: 1 addition & 1 deletion extern/godot-engine
Submodule godot-engine updated 5294 files
22 changes: 11 additions & 11 deletions project/addons/orchestrator/orchestrator.gdextension
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[configuration]

entry_symbol = "extension_library_init"
compatibility_minimum="4.3"
compatibility_minimum="4.4"
reloadable = false

[libraries]

linux.x86_64 = "res://addons/orchestrator/orchestrator.linux.64.release.so"
#linux.debug.x86_64 = "res://addons/orchestrator/orchestrator.linux.64.debug.so"
linux.x86_64 = "res://addons/orchestrator/orchestrator.linux.x86_64.release.so"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These filenames I assume were taken from my PR, but you have specifically set the name to use ORCHESTRATOR_ARCH so this will break.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @enetheru agreed, I have highlighted this in the above comment. I don't have a way to test the builds locally, so this was my first pass to see how things would land on multi-architecture builds. Will be fixed in the next rebase.

#linux.debug.x86_64 = "res://addons/orchestrator/orchestrator.linux.x86_64.debug.so"

macos = "res://addons/orchestrator/orchestrator.darwin.64.release.dylib"
#macos.debug = "res://addons/orchestrator/orchestrator.darwin.64.debug.dylib"
macos = "res://addons/orchestrator/orchestrator.darwin.x86_64.release.dylib"
#macos.debug = "res://addons/orchestrator/orchestrator.darwin.x86_64.debug.dylib"

windows.x86_64 = "res://addons/orchestrator/orchestrator.windows.64.release.dll"
#windows.debug.x86_64 = "res://addons/orchestrator/orchestrator.windows.64.debug.dll"
windows.x86_64 = "res://addons/orchestrator/orchestrator.windows.x86_64.release.dll"
#windows.debug.x86_64 = "res://addons/orchestrator/orchestrator.windows.x86_64.debug.dll"

android.arm32 = "res://addons/orchestrator/liborchestrator.android.32.release.so"
#android.debug.arm32 = "res://addons/orchestrator/liborchestrator.android.32.debug.so"
android.arm32 = "res://addons/orchestrator/liborchestrator.android.x86_32.release.so"
#android.debug.arm32 = "res://addons/orchestrator/liborchestrator.android.x86_32.debug.so"

android.arm64 = "res://addons/orchestrator/liborchestrator.android.64.release.so"
#android.debug.arm64 = "res://addons/orchestrator/liborchestrator.android.64.debug.so"
android.arm64 = "res://addons/orchestrator/liborchestrator.android.x86_64.release.so"
#android.debug.arm64 = "res://addons/orchestrator/liborchestrator.android.x86_64.debug.so"
2 changes: 1 addition & 1 deletion project/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config_version=5

config/name="Orchestrator GDExtension"
run/main_scene="res://scenes/world_3d/world_3d.tscn"
config/features=PackedStringArray("4.3", "Forward Plus")
config/features=PackedStringArray("4.4", "Forward Plus")
config/icon="res://icon.svg"

[doc_classes]
Expand Down
Loading
Loading