From 6071c16c41ff40b6b868228d8822711ebc6a323e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=20Fam=C3=A0?= Date: Wed, 29 Jan 2025 11:46:45 +0100 Subject: [PATCH] Update godot-cpp (4.3 cherry-picks); Add build profiles (#141) (cherry picked from f0563ce8cfb9e9ce4c91197bdce9ed6a9c105907) --- .github/workflows/build_all.yml | 16 +++--- addons/Wwise/native/build_profile_editor.json | 49 +++++++++++++++++++ .../Wwise/native/build_profile_runtime.json | 22 +++++++++ addons/Wwise/native/godot-cpp | 2 +- .../native/src/core/types/wwise_base_type.h | 2 +- .../Wwise/native/src/core/types/wwise_event.h | 4 +- addons/Wwise/native/src/core/utils.h | 18 ++++--- 7 files changed, 96 insertions(+), 17 deletions(-) create mode 100644 addons/Wwise/native/build_profile_editor.json create mode 100644 addons/Wwise/native/build_profile_runtime.json diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index 87bc5fd3..ba067ca5 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -13,6 +13,8 @@ env: GODOT_ENGINE_VERSION: "4.3.0" GODOT_ENGINE_STAGE: "stable" INTEGRATION_VERSION: "3.0.0" + BUILD_PROFILE_EDITOR: "build_profile_editor.json" + BUILD_PROFILE_RUNTIME: "build_profile_runtime.json" jobs: build-all: @@ -208,7 +210,7 @@ jobs: run: | cd addons/Wwise/native mkdir -p godot-cpp/bin - scons platform=${{ matrix.scons-platform }} target=editor wwise_config=profile use_static_cpp=yes wwise_sdk=wwise_sdk + scons platform=${{ matrix.scons-platform }} target=editor wwise_config=profile use_static_cpp=yes wwise_sdk=wwise_sdk build_profile=${{ env.BUILD_PROFILE_EDITOR }} cd ../../../ - name: Compile template_debug library @@ -219,7 +221,7 @@ jobs: SCONS_CACHE_LIMIT: 7168 run: | cd addons/Wwise/native - scons platform=${{ matrix.scons-platform }} target=template_debug wwise_config=profile use_static_cpp=yes wwise_sdk=wwise_sdk ${{ matrix.debug-flags }} + scons platform=${{ matrix.scons-platform }} target=template_debug wwise_config=profile use_static_cpp=yes wwise_sdk=wwise_sdk build_profile=${{ env.BUILD_PROFILE_RUNTIME }} ${{ matrix.debug-flags }} cd ../../../ - name: Compile template_release library @@ -230,7 +232,7 @@ jobs: SCONS_CACHE_LIMIT: 7168 run: | cd addons/Wwise/native - scons platform=${{ matrix.scons-platform }} target=template_release wwise_config=release use_static_cpp=yes wwise_sdk=wwise_sdk ${{ matrix.release-flags }} + scons platform=${{ matrix.scons-platform }} target=template_release wwise_config=release use_static_cpp=yes wwise_sdk=wwise_sdk build_profile=${{ env.BUILD_PROFILE_RUNTIME }} ${{ matrix.release-flags }} cd ../../../ - name: Compile Android libraries @@ -241,10 +243,10 @@ jobs: WWISESDK=$(pwd) cd ../godot-cpp mkdir -p bin - scons platform=android target=template_debug dev_build=yes -j6 ${{ matrix.debug-flags-arm64 }} - scons platform=android target=template_debug dev_build=yes -j6 ${{ matrix.debug-flags-arm32 }} - scons platform=android target=template_release -j6 ${{ matrix.release-flags-arm64 }} - scons platform=android target=template_release -j6 ${{ matrix.release-flags-arm32 }} + scons platform=android target=template_debug dev_build=yes build_profile="../build_profile_runtime.json" -j6 ${{ matrix.debug-flags-arm64 }} + scons platform=android target=template_debug dev_build=yes build_profile="../build_profile_runtime.json" -j6 ${{ matrix.debug-flags-arm32 }} + scons platform=android target=template_release build_profile="../build_profile_runtime.json" -j6 ${{ matrix.release-flags-arm64 }} + scons platform=android target=template_release build_profile="../build_profile_runtime.json" -j6 ${{ matrix.release-flags-arm32 }} cd ../android chmod +x ./gradlew ./gradlew assemble -PWWISE_SDK="$WWISESDK" diff --git a/addons/Wwise/native/build_profile_editor.json b/addons/Wwise/native/build_profile_editor.json new file mode 100644 index 00000000..67a36b3c --- /dev/null +++ b/addons/Wwise/native/build_profile_editor.json @@ -0,0 +1,49 @@ +{ + "enabled_classes":[ + "AcceptDialog", + "Area3D", + "ArrayMesh", + "BoxShape3D", + "Button", + "CollisionShape3D", + "ConfigFile", + "DirAccess", + "DisplayServer", + "EditorExportPlatform", + "EditorExportPlugin", + "EditorFileSystem", + "EditorInspectorPlugin", + "EditorInterface", + "EditorNode3DGizmo", + "EditorNode3DGizmoPlugin", + "EditorPlugin", + "EditorProperty", + "EditorSettings", + "Engine", + "FileAccess", + "HBoxContainer", + "JSON", + "LineEdit", + "MeshDataTool", + "MeshInstance3D", + "Node2D", + "Node3D", + "OS", + "PackedScene", + "ProjectSettings", + "ResourceLoader", + "ResourceSaver", + "SceneTree", + "Script", + "Shortcut", + "StandardMaterial3D", + "Texture2D", + "Thread", + "Time", + "Timer", + "Tree", + "TreeItem", + "VBoxContainer", + "WorkerThreadPool" + ] +} \ No newline at end of file diff --git a/addons/Wwise/native/build_profile_runtime.json b/addons/Wwise/native/build_profile_runtime.json new file mode 100644 index 00000000..c549138c --- /dev/null +++ b/addons/Wwise/native/build_profile_runtime.json @@ -0,0 +1,22 @@ +{ + "enabled_classes": [ + "Area3D", + "ArrayMesh", + "BoxShape3D", + "CollisionShape3D", + "DisplayServer", + "Engine", + "Material", + "MeshDataTool", + "MeshInstance3D", + "Node2D", + "Node3D", + "OS", + "ProjectSettings", + "ResourceLoader", + "SceneTree", + "Texture2D", + "Thread", + "Window" + ] +} \ No newline at end of file diff --git a/addons/Wwise/native/godot-cpp b/addons/Wwise/native/godot-cpp index e298f430..f3a1a2fd 160000 --- a/addons/Wwise/native/godot-cpp +++ b/addons/Wwise/native/godot-cpp @@ -1 +1 @@ -Subproject commit e298f430b55bdbd9cf3eae9e041354c26d2e9c79 +Subproject commit f3a1a2fd458dfaf4de08c906f22a2fe9e924b16f diff --git a/addons/Wwise/native/src/core/types/wwise_base_type.h b/addons/Wwise/native/src/core/types/wwise_base_type.h index bec3a6c5..287eddce 100644 --- a/addons/Wwise/native/src/core/types/wwise_base_type.h +++ b/addons/Wwise/native/src/core/types/wwise_base_type.h @@ -2,6 +2,7 @@ #if defined(TOOLS_ENABLED) #include "editor/ak_editor_settings.h" +#include #endif #include "core/utils.h" @@ -9,7 +10,6 @@ #include "editor/short_id_generator.h" #include #include -#include using namespace godot; diff --git a/addons/Wwise/native/src/core/types/wwise_event.h b/addons/Wwise/native/src/core/types/wwise_event.h index 3983e95b..26f48246 100644 --- a/addons/Wwise/native/src/core/types/wwise_event.h +++ b/addons/Wwise/native/src/core/types/wwise_event.h @@ -2,12 +2,12 @@ #ifdef TOOLS_ENABLED #include "editor/wwise_project_database.h" +#include +#include #endif #include "core/types/wwise_base_type.h" #include "core/wwise_gdextension.h" -#include -#include #include using namespace godot; diff --git a/addons/Wwise/native/src/core/utils.h b/addons/Wwise/native/src/core/utils.h index 72088cc8..aebe2715 100644 --- a/addons/Wwise/native/src/core/utils.h +++ b/addons/Wwise/native/src/core/utils.h @@ -1,7 +1,10 @@ #pragma once -#include "AK/SoundEngine/Common/AkTypes.h" +#if defined(TOOLS_ENABLED) #include +#endif + +#include "AK/SoundEngine/Common/AkTypes.h" #include #include #include @@ -329,6 +332,13 @@ static inline bool find_matching_vertex(Vector3 vertex, Dictionary vert_dict, in } } + +static inline AkGameObjectID get_ak_game_object_id(const Node* p_node) +{ + return p_node == nullptr ? AK_INVALID_GAME_OBJECT : p_node->get_instance_id(); +} + +#if defined(TOOLS_ENABLED) static bool make_dir_recursive(const String& p_directory) { if (!DirAccess::dir_exists_absolute(p_directory)) @@ -364,8 +374,4 @@ static PackedStringArray take(const PackedStringArray& folders, int n) } return result; } - -static inline AkGameObjectID get_ak_game_object_id(const Node* p_node) -{ - return p_node == nullptr ? AK_INVALID_GAME_OBJECT : p_node->get_instance_id(); -} \ No newline at end of file +#endif