Signed-off-by: falkTX <falktx@falktx.com>pull/321/head
@@ -175,20 +175,24 @@ endif | |||||
endif | endif | ||||
ifeq ($(MACOS),true) | ifeq ($(MACOS),true) | ||||
# MacOS linker flags | # MacOS linker flags | ||||
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-dead_strip,-dead_strip_dylibs | LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-dead_strip,-dead_strip_dylibs | ||||
ifneq ($(SKIP_STRIPPING),true) | ifneq ($(SKIP_STRIPPING),true) | ||||
LINK_OPTS += -Wl,-x | LINK_OPTS += -Wl,-x | ||||
endif | endif | ||||
else | else | ||||
# Common linker flags | # Common linker flags | ||||
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-O1,--gc-sections | LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-O1,--gc-sections | ||||
ifneq ($(WASM),true) | |||||
LINK_OPTS += -Wl,--as-needed | |||||
ifneq ($(SKIP_STRIPPING),true) | ifneq ($(SKIP_STRIPPING),true) | ||||
LINK_OPTS += -Wl,--strip-all | LINK_OPTS += -Wl,--strip-all | ||||
endif | endif | ||||
ifneq ($(WASM),true) | |||||
LINK_OPTS += -Wl,--as-needed | |||||
endif | endif | ||||
endif | endif | ||||
ifeq ($(SKIP_STRIPPING),true) | ifeq ($(SKIP_STRIPPING),true) | ||||
@@ -535,6 +539,8 @@ endif | |||||
ifeq ($(MACOS),true) | ifeq ($(MACOS),true) | ||||
LIB_EXT = .dylib | LIB_EXT = .dylib | ||||
else ifeq ($(WASM),true) | |||||
LIB_EXT = .wasm | |||||
else ifeq ($(WINDOWS),true) | else ifeq ($(WINDOWS),true) | ||||
LIB_EXT = .dll | LIB_EXT = .dll | ||||
else | else | ||||
@@ -547,7 +553,7 @@ endif | |||||
ifeq ($(MACOS),true) | ifeq ($(MACOS),true) | ||||
SHARED = -dynamiclib | SHARED = -dynamiclib | ||||
else ifeq ($(WASM),true) | else ifeq ($(WASM),true) | ||||
SHARED = -sSIDE_MODULE=1 | |||||
SHARED = -sSIDE_MODULE=2 | |||||
else | else | ||||
SHARED = -shared | SHARED = -shared | ||||
endif | endif | ||||
@@ -170,9 +170,9 @@ SYMBOLS_SHARED = -Wl,-exported_symbols_list,$(DPF_PATH)/utils/symbols/shared.exp | |||||
else ifeq ($(WASM),true) | else ifeq ($(WASM),true) | ||||
SYMBOLS_LADSPA = -sEXPORTED_FUNCTIONS="['ladspa_descriptor']" | SYMBOLS_LADSPA = -sEXPORTED_FUNCTIONS="['ladspa_descriptor']" | ||||
SYMBOLS_DSSI = -sEXPORTED_FUNCTIONS="['ladspa_descriptor','dssi_descriptor']" | SYMBOLS_DSSI = -sEXPORTED_FUNCTIONS="['ladspa_descriptor','dssi_descriptor']" | ||||
SYMBOLS_LV2DSP = -sEXPORTED_FUNCTIONS="['lv2_descriptor']" | |||||
SYMBOLS_LV2DSP = -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2_generate_ttl']" | |||||
SYMBOLS_LV2UI = -sEXPORTED_FUNCTIONS="['lv2ui_descriptor']" | SYMBOLS_LV2UI = -sEXPORTED_FUNCTIONS="['lv2ui_descriptor']" | ||||
SYMBOLS_LV2 = -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2ui_descriptor']" | |||||
SYMBOLS_LV2 = -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2_generate_ttl','lv2ui_descriptor']" | |||||
SYMBOLS_VST2 = -sEXPORTED_FUNCTIONS="['VSTPluginMain']" | SYMBOLS_VST2 = -sEXPORTED_FUNCTIONS="['VSTPluginMain']" | ||||
SYMBOLS_VST3 = -sEXPORTED_FUNCTIONS="['GetPluginFactory','ModuleEntry','ModuleExit']" | SYMBOLS_VST3 = -sEXPORTED_FUNCTIONS="['GetPluginFactory','ModuleEntry','ModuleExit']" | ||||
SYMBOLS_SHARED = -sEXPORTED_FUNCTIONS="['createSharedPlugin']" | SYMBOLS_SHARED = -sEXPORTED_FUNCTIONS="['createSharedPlugin']" | ||||
@@ -1665,7 +1665,7 @@ static struct Cleanup { | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
DISTRHO_PLUGIN_EXPORT | DISTRHO_PLUGIN_EXPORT | ||||
#if DISTRHO_OS_WINDOWS || DISTRHO_OS_MAC | |||||
#if DISTRHO_OS_MAC || DISTRHO_OS_WASM || DISTRHO_OS_WINDOWS | |||||
const AEffect* VSTPluginMain(audioMasterCallback audioMaster); | const AEffect* VSTPluginMain(audioMasterCallback audioMaster); | ||||
#else | #else | ||||
const AEffect* VSTPluginMain(audioMasterCallback audioMaster) asm ("main"); | const AEffect* VSTPluginMain(audioMasterCallback audioMaster) asm ("main"); | ||||
@@ -204,11 +204,13 @@ struct SDLBridge { | |||||
self->jackProcessCallback(numFrames, self->jackProcessArg); | self->jackProcessCallback(numFrames, self->jackProcessArg); | ||||
#if DISTRHO_PLUGIN_NUM_OUTPUTS > 0 | |||||
for (uint i=0; i < DISTRHO_PLUGIN_NUM_OUTPUTS; ++i) | for (uint i=0; i < DISTRHO_PLUGIN_NUM_OUTPUTS; ++i) | ||||
{ | { | ||||
for (uint j=0; j < numFrames; ++j) | for (uint j=0; j < numFrames; ++j) | ||||
fstream[j * DISTRHO_PLUGIN_NUM_OUTPUTS + i] = self->audioBuffers[DISTRHO_PLUGIN_NUM_INPUTS+i][j]; | fstream[j * DISTRHO_PLUGIN_NUM_OUTPUTS + i] = self->audioBuffers[DISTRHO_PLUGIN_NUM_INPUTS+i][j]; | ||||
} | } | ||||
#endif | |||||
} | } | ||||
}; | }; | ||||