-
Notifications
You must be signed in to change notification settings - Fork 61
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
e36e859
9cdb1b0
11babb9
6ee23d6
503fc66
a5fcdb5
7d7269c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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}) | ||
|
@@ -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) | ||
|
@@ -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}" | ||
# 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}: | ||
|
@@ -126,7 +123,7 @@ TARGET_COMPILE_OPTIONS(${PROJECT_NAME} PUBLIC | |
/MDd | ||
> | ||
$<$<CONFIG:Release>: | ||
/MD | ||
/MT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, I see the logic for this in |
||
/O2 | ||
> | ||
> | ||
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
@@ -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) | ||
|
||
|
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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" |
There was a problem hiding this comment.
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.