Skip to content

Commit

Permalink
Update godot-cpp (4.3 cherry-picks); Add build profiles (#141)
Browse files Browse the repository at this point in the history
(cherry picked from f0563ce)
  • Loading branch information
alessandrofama committed Jan 29, 2025
1 parent 3a86810 commit 6071c16
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 17 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down
49 changes: 49 additions & 0 deletions addons/Wwise/native/build_profile_editor.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
22 changes: 22 additions & 0 deletions addons/Wwise/native/build_profile_runtime.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"enabled_classes": [
"Area3D",
"ArrayMesh",
"BoxShape3D",
"CollisionShape3D",
"DisplayServer",
"Engine",
"Material",
"MeshDataTool",
"MeshInstance3D",
"Node2D",
"Node3D",
"OS",
"ProjectSettings",
"ResourceLoader",
"SceneTree",
"Texture2D",
"Thread",
"Window"
]
}
2 changes: 1 addition & 1 deletion addons/Wwise/native/src/core/types/wwise_base_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

#if defined(TOOLS_ENABLED)
#include "editor/ak_editor_settings.h"
#include <godot_cpp/classes/resource_saver.hpp>
#endif

#include "core/utils.h"
#include "core/wwise_object_type.h"
#include "editor/short_id_generator.h"
#include <godot_cpp/classes/resource.hpp>
#include <godot_cpp/classes/resource_loader.hpp>
#include <godot_cpp/classes/resource_saver.hpp>

using namespace godot;

Expand Down
4 changes: 2 additions & 2 deletions addons/Wwise/native/src/core/types/wwise_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#ifdef TOOLS_ENABLED
#include "editor/wwise_project_database.h"
#include <godot_cpp/classes/editor_file_system.hpp>
#include <godot_cpp/classes/editor_interface.hpp>
#endif

#include "core/types/wwise_base_type.h"
#include "core/wwise_gdextension.h"
#include <godot_cpp/classes/editor_file_system.hpp>
#include <godot_cpp/classes/editor_interface.hpp>
#include <godot_cpp/classes/node3d.hpp>

using namespace godot;
Expand Down
18 changes: 12 additions & 6 deletions addons/Wwise/native/src/core/utils.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#pragma once

#include "AK/SoundEngine/Common/AkTypes.h"
#if defined(TOOLS_ENABLED)
#include <godot_cpp/classes/dir_access.hpp>
#endif

#include "AK/SoundEngine/Common/AkTypes.h"
#include <godot_cpp/classes/engine.hpp>
#include <godot_cpp/classes/node.hpp>
#include <godot_cpp/variant/utility_functions.hpp>
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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();
}
#endif

0 comments on commit 6071c16

Please sign in to comment.