Skip to content

Commit

Permalink
test unity build
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrofama committed Jul 14, 2024
1 parent 44a3e50 commit 57285c7
Show file tree
Hide file tree
Showing 54 changed files with 520 additions and 849 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- unity-build
- dev
pull_request:
branches:
Expand Down Expand Up @@ -203,7 +204,7 @@ jobs:
7z x wwise_sdk_2023.1.0_android.zip
cd ../../../../
- name: Compile Debug library
- name: Compile Editor library
if: matrix.sdk-platform != 'android'
shell: bash
env:
Expand All @@ -212,7 +213,18 @@ jobs:
run: |
cd addons/Wwise/native
mkdir -p godot-cpp/bin
scons platform=${{ matrix.scons-platform }} target=template_debug dev_build=yes asserts=true wwise_sdk=wwise_sdk -j6 ${{ matrix.debug-flags }}
scons platform=${{ matrix.scons-platform }} target=editor debug_symbols=yes wwise_sdk=wwise_sdk -j6 ${{ matrix.debug-flags }}
cd ../../../
- name: Compile Debug library
if: matrix.sdk-platform != 'android'
shell: bash
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
SCONS_CACHE_LIMIT: 7168
run: |
cd addons/Wwise/native
scons platform=${{ matrix.scons-platform }} target=template_debug dev_build=yes debug_symbols=yes asserts=yes wwise_sdk=wwise_sdk -j6 ${{ matrix.debug-flags }}
cd ../../../
- name: Compile Release library
Expand Down
67 changes: 34 additions & 33 deletions addons/Wwise/native/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,25 @@ wwise_soundengine_sample_path = ""

if env["platform"] == "windows":
wwise_soundengine_sample_path = env["wwise_sdk"] + "/samples/SoundEngine/Win32/"
if env["target"] in ("template_debug"):
if env["target"] in ("editor", "template_debug"):
wwise_sdk_libs_path = env["wwise_sdk"] + "/x64_vc160/Debug(StaticCRT)/lib/"
else:
wwise_sdk_libs_path = env["wwise_sdk"] + "/x64_vc160/Release(StaticCRT)/lib/"

if env["platform"] == "macos":
wwise_soundengine_sample_path = env["wwise_sdk"] + "/samples/SoundEngine/POSIX/"
if env["target"] in ("template_debug"):
if env["target"] in ("editor", "template_debug"):
wwise_sdk_libs_path = env["wwise_sdk"] + "/Mac/Debug/lib/"
else:
wwise_sdk_libs_path = env["wwise_sdk"] + "/Mac/Release/lib/"

if env["platform"] == "linux":
wwise_soundengine_sample_path = env["wwise_sdk"] + "/samples/SoundEngine/POSIX/"
if env["target"] in ("editor", "template_debug"):
wwise_sdk_libs_path = env["wwise_sdk"] + "/Linux_x64/Debug/lib/"
else:
wwise_sdk_libs_path = env["wwise_sdk"] + "/Linux_x64/Release/lib/"

if env["platform"] == "ios" and not env["ios_simulator"]:
wwise_soundengine_sample_path = env["wwise_sdk"] + "/samples/SoundEngine/POSIX/"
if env["target"] in ("template_debug"):
Expand All @@ -84,14 +91,8 @@ if env["platform"] == "ios" and env["ios_simulator"]:
else:
wwise_sdk_libs_path = env["wwise_sdk"] + "/iOS/Release-iphonesimulator/lib/"

if env["platform"] == "linux":
wwise_soundengine_sample_path = env["wwise_sdk"] + "/samples/SoundEngine/POSIX/"
if env["target"] in ("template_debug"):
wwise_sdk_libs_path = env["wwise_sdk"] + "/Linux_x64/Debug/lib/"
else:
wwise_sdk_libs_path = env["wwise_sdk"] + "/Linux_x64/Release/lib/"

wwise_soundengine_sample_common_path = env["wwise_sdk"] + "/samples/SoundEngine/Common/"
wwise_soundengine_common_include_path = wwise_sdk_headers_path + "AK/SoundEngine/Common/"

## Wwise libs
wwise_memorymanager_library = "AkMemoryMgr"
Expand Down Expand Up @@ -161,13 +162,17 @@ print("Wwise SDK libs path: " + wwise_sdk_libs_path)
# Windows build settings
if env["platform"] == "windows":
env["target_path"] += "/win64/"
if env["target"] in ("template_debug"):
env["target_path"] += "debug/"
if env["target"] in ("editor", "template_debug"):
if env["platform"] == "editor":
env["target_path"] += "editor/"
else:
env["target_path"] += "debug/"

env.Append(CPPDEFINES=["_DEBUG"])
env.Append(LINKFLAGS=["-DEBUG"])
env.Append(CCFLAGS=["/MTd"])
if env["asserts"]:
env.Append(CPPDEFINES=["AK_ENABLE_ASSERTS"])
env.Append(CCFLAGS=["/MTd"])
else:
env["target_path"] += "release/"
env.Append(CPPDEFINES=["AK_OPTIMIZED"])
Expand All @@ -186,8 +191,12 @@ if env["platform"] == "windows":
# macOS build settings
elif env["platform"] == "macos":
env["target_path"] += "/macos/"
if env["target"] in ("template_debug"):
env["target_path"] += "debug/"
if env["target"] in ("editor", "template_debug"):
if env["platform"] == "editor":
env["target_path"] += "editor/"
else:
env["target_path"] += "debug/"

if env["asserts"]:
env.Append(CPPDEFINES=["AK_ENABLE_ASSERTS"])
else:
Expand Down Expand Up @@ -215,8 +224,12 @@ elif env["platform"] == "macos":
# linux build settings
elif env["platform"] == "linux":
env["target_path"] += "/linux/"
if env["target"] in ("template_debug"):
env["target_path"] += "debug/"
if env["target"] in ("editor", "template_debug"):
if env["platform"] == "editor":
env["target_path"] += "editor/"
else:
env["target_path"] += "debug/"

if env["asserts"]:
env.Append(CPPDEFINES=["AK_ENABLE_ASSERTS"])
else:
Expand Down Expand Up @@ -315,28 +328,16 @@ env.Append(
)
env.Append(LIBPATH=[cpp_bindings_path + "bin/"])

env.Append(CPPPATH=["src/", "src/scene/", "src/editor/", "src/editor/inspector_plugin/", "src/editor/event_gizmo/", "src/editor/export_plugin/"])
env.Append(CPPPATH=["src/"])

sources = []
sources.append(Glob("src/*.cpp"))
sources.append(Glob("src/scene/*.cpp"))
sources.append(Glob("src/editor/inspector_plugin/*.cpp"))
sources.append(Glob("src/editor/ak_editor_utils.cpp"))
sources.append("src/wwise_gdextension_main.cpp")

if env["platform"] == "windows" or env["platform"] == "macos":
env.Append(CPPPATH=["src/waapi/"])
env.Append(CPPPATH=["src/editor/waapi_picker/"])
sources.append(Glob("src/waapi/*.cpp"))
sources.append(Glob("src/editor/waapi_picker/*.cpp"))

env.Append(LIBS=["AkAutobahn"])

if env["platform"] != "windows":
sources.append(Glob(wwise_soundengine_sample_path + "*.cpp"))
sources.append(Glob(wwise_soundengine_sample_common_path + "*.cpp"))

# Wwise specific configuration
env.Append(CPPPATH=[wwise_sdk_headers_path, wwise_soundengine_sample_path])
env.Append(CPPPATH=[wwise_sdk_headers_path, wwise_soundengine_sample_path, wwise_soundengine_sample_common_path, wwise_soundengine_common_include_path])
env.Append(LIBPATH=[wwise_sdk_libs_path])
env.Append(
LIBS=[
Expand All @@ -348,7 +349,7 @@ env.Append(
]
)

if env["target"] in ("template_debug"):
if env["target"] in ("editor", "template_debug"):
env.Append(LIBS=[wwise_communications_library])

if env["platform"] == "windows":
Expand Down Expand Up @@ -451,4 +452,4 @@ if env["platform"] == "ios":

Default(library)

Help(opts.GenerateHelpText(env))
Help(opts.GenerateHelpText(env))
23 changes: 3 additions & 20 deletions addons/Wwise/native/android/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,34 +164,17 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-conversion-null -Wno-deprecated-dec
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--start-group -Wl,--end-group")

# Define source files
file(GLOB WWISE_SOURCES
${CMAKE_SOURCE_DIR}/../../src/*.cpp
${CMAKE_SOURCE_DIR}/../../src/scene/*.cpp
${CMAKE_SOURCE_DIR}/../../src/android/*.cpp
${CMAKE_SOURCE_DIR}/../../src/editor/inspector_plugin/*.cpp
${CMAKE_SOURCE_DIR}/../../src/editor/ak_editor_utils.cpp
)
set(WWISE_SOURCES
${CMAKE_SOURCE_DIR}/../../src/wwise_gdextension_main.cpp
)

file(GLOB WWISE_HEADERS
${CMAKE_SOURCE_DIR}/../../src/*.h
${CMAKE_SOURCE_DIR}/../../src/scene/*.h
${CMAKE_SOURCE_DIR}/../../src/android/*.h
${CMAKE_SOURCE_DIR}/../../src/editor/*.h
${CMAKE_SOURCE_DIR}/../../src/editor/inspector_plugin/*.h
${CMAKE_SOURCE_DIR}/../../src/editor/event_gizmo/*.h
${CMAKE_SOURCE_DIR}/../../src/editor/export_plugin/*.h
${WWISE_SOUNDENGINE_SAMPLE_PATH}libzip/lib/*.h
${WWISE_SDK}/samples/SoundEngine/POSIX/*.h
)

list(APPEND WWISE_INCLUDE_DIRECTORIES
"${CMAKE_SOURCE_DIR}/../../src/"
"${CMAKE_SOURCE_DIR}/../../src/scene/"
"${CMAKE_SOURCE_DIR}/../../src/android/"
"${CMAKE_SOURCE_DIR}/../../src/editor/"
"${CMAKE_SOURCE_DIR}/../../src/editor/inspector_plugin/"
"${CMAKE_SOURCE_DIR}/../../src/editor/event_gizmo/"
"${CMAKE_SOURCE_DIR}/../../src/editor/export_plugin/"
"${WWISE_SOUNDENGINE_SAMPLE_PATH}libzip/lib/"
"${WWISE_SDK}/samples/SoundEngine/POSIX/"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#include "wwise_godot_io.h"
#include "ak_io_hook.h"

#define BLOCKING_DEVICE_NAME AKTEXT("Blocking Device")

using namespace godot;

AkFileDesc* AkIOHookGodot::create_descriptor(const AkFileDesc* in_p_copy)
{
if (!in_p_copy)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
#ifndef __WWISE_GODOT_IO_H__
#define __WWISE_GODOT_IO_H__

#include <AK/SoundEngine/Common/AkStreamMgrModule.h>
#include <AK/SoundEngine/Common/AkTypes.h>
#include <AK/Tools/Common/AkObject.h>
#include <godot_cpp/classes/file_access.hpp>

namespace godot
{
class AkIOHookGodot : public AK::StreamMgr::IAkLowLevelIOHook
{
struct FileHandle
Expand Down Expand Up @@ -65,8 +55,4 @@ class AkFileIOHandlerGodot : public AK::StreamMgr::IAkFileLocationResolver

void set_banks_path(const String& banks_path);
void set_language_folder(const String& language_folder);
};

} //namespace godot

#endif
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#include "wwise_settings.h"
#include "ak_settings.h"

using namespace godot;
void AkSettings::_bind_methods() {}

void WwiseSettings::_bind_methods() {}

WwiseSettings::WwiseSettings()
AkSettings::AkSettings()
{
add_wwise_settings();

Expand All @@ -14,7 +12,7 @@ WwiseSettings::WwiseSettings()
if (error)
{
UtilityFunctions::push_error(
String("Encountered error {0} when saving Wwise Project Settings").format(Array::make(error)));
String("[Wwise] Encountered error {0} when saving Wwise Project Settings").format(Array::make(error)));
}
else
{
Expand All @@ -23,7 +21,7 @@ WwiseSettings::WwiseSettings()
}
}

void WwiseSettings::add_wwise_settings()
void AkSettings::add_wwise_settings()
{
add_setting(WWISE_COMMON_USER_SETTINGS_PATH + "base_path", String("res://GeneratedSoundBanks"),
Variant::Type::STRING, PROPERTY_HINT_DIR, "res://GeneratedSoundBanks");
Expand Down Expand Up @@ -120,7 +118,7 @@ void WwiseSettings::add_wwise_settings()
"PulseAudio, ALSA");
}

void WwiseSettings::add_setting(const String& name, const Variant& default_value, Variant::Type type, PropertyHint hint,
void AkSettings::add_setting(const String& name, const Variant& default_value, Variant::Type type, PropertyHint hint,
const String& hint_string, int usage)
{
Dictionary setting;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
#ifndef WWISE_SETTINGS_H
#define WWISE_SETTINGS_H

#include <godot_cpp/classes/engine.hpp>
#include <godot_cpp/classes/project_settings.hpp>
#include <godot_cpp/classes/ref_counted.hpp>
#include <godot_cpp/variant/string.hpp>
#include <godot_cpp/variant/utility_functions.hpp>
#include <godot_cpp/variant/variant.hpp>

namespace godot
{
class WwiseSettings : public RefCounted
class AkSettings : public RefCounted
{
GDCLASS(WwiseSettings, RefCounted);
GDCLASS(AkSettings, RefCounted);

protected:
static void _bind_methods();

public:
WwiseSettings();
AkSettings();

private:
String WWISE_COMMON_USER_SETTINGS_PATH = "wwise/common_user_settings/";
Expand All @@ -35,8 +23,4 @@ class WwiseSettings : public RefCounted
void add_wwise_settings();
void add_setting(const String& name, const Variant& default_value, Variant::Type type,
PropertyHint hint = PROPERTY_HINT_NONE, const String& hint_string = "", int usage = PROPERTY_USAGE_DEFAULT);
};

} // namespace godot

#endif // WWISE_SETTINGS_H
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "ak_utils.h"

using namespace godot;

AkUtils* AkUtils::singleton = nullptr;

void AkUtils::_bind_methods()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#ifndef AK_UTILS_H
#define AK_UTILS_H

#include <godot_cpp/classes/ref_counted.hpp>

namespace godot
{

class CookieWrapper : public Object
{
GDCLASS(CookieWrapper, Object);
Expand Down Expand Up @@ -154,12 +146,9 @@ class AkUtils : public Object
~AkUtils();
static AkUtils* get_singleton();
};
} //namespace godot

VARIANT_ENUM_CAST(AkUtils::GameEvent);
VARIANT_ENUM_CAST(AkUtils::AkCurveInterpolation);
VARIANT_ENUM_CAST(AkUtils::AkCallbackType);
VARIANT_ENUM_CAST(AkUtils::MultiPositionType);
VARIANT_ENUM_CAST(AkUtils::AkCodecID);

#endif
VARIANT_ENUM_CAST(AkUtils::AkCodecID);
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "waapi_gdextension.h"

using namespace godot;

Waapi* Waapi::singleton = nullptr;

struct PendingCallback
Expand Down
Loading

0 comments on commit 57285c7

Please sign in to comment.