wasm related tweaks, still WIP
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
f4c2c03003
commit
d03e73119d
5 changed files with 24 additions and 4 deletions
|
@ -17,6 +17,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __HAIKU__
|
||||
// these are missing from HaikuOS
|
||||
#define pthread_setname_np(...)
|
||||
|
||||
static int pthread_getcpuclockid(pthread_t, clockid_t* const clock_id)
|
||||
|
@ -24,6 +26,7 @@ static int pthread_getcpuclockid(pthread_t, clockid_t* const clock_id)
|
|||
*clock_id = CLOCK_REALTIME;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int backtrace(void**, int)
|
||||
{
|
|
@ -47,7 +47,10 @@
|
|||
#include "DistrhoPluginUtils.hpp"
|
||||
#include "PluginContext.hpp"
|
||||
#include "extra/Base64.hpp"
|
||||
#include "extra/SharedResourcePointer.hpp"
|
||||
|
||||
#ifndef DISTRHO_OS_WASM
|
||||
# include "extra/SharedResourcePointer.hpp"
|
||||
#endif
|
||||
|
||||
static const constexpr uint kCardinalStateBaseCount = 3; // patch, screenshot, comment
|
||||
|
||||
|
@ -173,7 +176,9 @@ struct Initializer
|
|||
else
|
||||
#endif
|
||||
{
|
||||
#if defined(ARCH_MAC)
|
||||
#if defined(DISTRHO_OS_WASM)
|
||||
asset::systemDir = "/resources";
|
||||
#elif defined(ARCH_MAC)
|
||||
asset::systemDir = "/Library/Application Support/Cardinal";
|
||||
#elif defined(ARCH_WIN)
|
||||
const std::string commonprogfiles = getSpecialPath(kSpecialPathCommonProgramFiles);
|
||||
|
@ -452,7 +457,11 @@ struct ScopedContext {
|
|||
|
||||
class CardinalPlugin : public CardinalBasePlugin
|
||||
{
|
||||
#ifdef DISTRHO_OS_WASM
|
||||
ScopedPointer<Initializer> fInitializer;
|
||||
#else
|
||||
SharedResourcePointer<Initializer> fInitializer;
|
||||
#endif
|
||||
|
||||
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
||||
/* If host audio ins == outs we can get issues for inplace processing.
|
||||
|
@ -484,7 +493,11 @@ class CardinalPlugin : public CardinalBasePlugin
|
|||
public:
|
||||
CardinalPlugin()
|
||||
: CardinalBasePlugin(kModuleParameters + kWindowParameterCount + 1, 0, kCardinalStateCount),
|
||||
#ifdef DISTRHO_OS_WASM
|
||||
fInitializer(new Initializer(this)),
|
||||
#else
|
||||
fInitializer(this),
|
||||
#endif
|
||||
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
||||
fAudioBufferCopy(nullptr),
|
||||
#endif
|
||||
|
|
|
@ -35,7 +35,9 @@ BASE_FLAGS += -DARCH_LIN
|
|||
endif
|
||||
|
||||
ifeq ($(HAIKU),true)
|
||||
BASE_FLAGS += -I../include/haiku-compat
|
||||
BASE_FLAGS += -I../include/linux-compat
|
||||
else ifeq ($(WASM),true)
|
||||
BASE_FLAGS += -I../include/linux-compat
|
||||
endif
|
||||
|
||||
BASE_FLAGS += -DPRIVATE=
|
||||
|
|
|
@ -204,7 +204,9 @@ BASE_FLAGS += -Wno-unused-variable
|
|||
# --------------------------------------------------------------
|
||||
# extra linker flags
|
||||
|
||||
ifeq ($(HAIKU),true)
|
||||
ifeq ($(WASM),true)
|
||||
LINK_FLAGS += --preload-file=./resources -sALLOW_MEMORY_GROWTH
|
||||
else ifeq ($(HAIKU),true)
|
||||
LINK_FLAGS += -lpthread
|
||||
else
|
||||
LINK_FLAGS += -pthread
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue