From 7a3d948d9c95a70382f5ddebecf635647c3f6c8b Mon Sep 17 00:00:00 2001 From: Sean Lee Date: Tue, 11 Jan 2022 21:43:16 -0500 Subject: [PATCH 01/12] Fix extension handling to work with the V2 SDK. --- src/DuktapeEngine.cpp | 2 +- src/FaustEngine.cpp | 2 +- src/LibPDEngine.cpp | 2 +- src/LuaJITEngine.cpp | 2 +- src/Prototype.cpp | 14 +++++++------- src/PythonEngine.cpp | 2 +- src/QuickJSEngine.cpp | 2 +- src/SuperColliderEngine.cpp | 4 ++-- src/VultEngine.cpp | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/DuktapeEngine.cpp b/src/DuktapeEngine.cpp index d9db2b9..b4ac027 100644 --- a/src/DuktapeEngine.cpp +++ b/src/DuktapeEngine.cpp @@ -219,5 +219,5 @@ struct DuktapeEngine : ScriptEngine { __attribute__((constructor(1000))) static void constructor() { - addScriptEngine("js"); + addScriptEngine(".js"); } diff --git a/src/FaustEngine.cpp b/src/FaustEngine.cpp index 6d6a987..3803c8c 100644 --- a/src/FaustEngine.cpp +++ b/src/FaustEngine.cpp @@ -369,5 +369,5 @@ private: __attribute__((constructor(1000))) static void constructor() { - addScriptEngine("dsp"); + addScriptEngine(".dsp"); } diff --git a/src/LibPDEngine.cpp b/src/LibPDEngine.cpp index 7be549f..1786ce2 100644 --- a/src/LibPDEngine.cpp +++ b/src/LibPDEngine.cpp @@ -331,5 +331,5 @@ void LibPDEngine::sendInitialStates(const ProcessBlock* block) { __attribute__((constructor(1000))) static void constructor() { - addScriptEngine("pd"); + addScriptEngine(".pd"); } diff --git a/src/LuaJITEngine.cpp b/src/LuaJITEngine.cpp index 0ec77ef..a2167a6 100644 --- a/src/LuaJITEngine.cpp +++ b/src/LuaJITEngine.cpp @@ -246,5 +246,5 @@ struct LuaJITEngine : ScriptEngine { __attribute__((constructor(1000))) static void constructor() { - addScriptEngine("lua"); + addScriptEngine(".lua"); } diff --git a/src/Prototype.cpp b/src/Prototype.cpp index 71c0673..afb18c6 100644 --- a/src/Prototype.cpp +++ b/src/Prototype.cpp @@ -334,7 +334,7 @@ struct Prototype : Module { std::string extension = system::getExtension(path); scriptEngine = createScriptEngine(extension); if (!scriptEngine) { - message = string::f("No engine for .%s extension", extension.c_str()); + message = string::f("No engine for %s extension", extension.c_str()); return; } scriptEngine->module = this; @@ -406,13 +406,13 @@ struct Prototype : Module { } void newScriptDialog() { - std::string ext = "js"; + std::string ext = ".js"; // Get current extension if a script is currently loaded if (!path.empty()) { ext = system::getExtension(path); } std::string dir = asset::plugin(pluginInstance, "examples"); - std::string filename = "Untitled." + ext; + std::string filename = "Untitled" + ext; char* newPathC = osdialog_file(OSDIALOG_SAVE, dir.c_str(), filename.c_str(), NULL); if (!newPathC) { return; @@ -436,7 +436,7 @@ struct Prototype : Module { } // Copy template to new script - std::string templatePath = asset::plugin(pluginInstance, "examples/template." + ext); + std::string templatePath = asset::plugin(pluginInstance, "examples/template" + ext); { std::ifstream templateFile(templatePath, std::ios::binary); std::ofstream newFile(newPath, std::ios::binary); @@ -468,7 +468,7 @@ struct Prototype : Module { std::string ext = system::getExtension(path); std::string dir = asset::plugin(pluginInstance, "examples"); - std::string filename = "Untitled." + ext; + std::string filename = "Untitled" + ext; char* newPathC = osdialog_file(OSDIALOG_SAVE, dir.c_str(), filename.c_str(), NULL); if (!newPathC) { return; @@ -478,7 +478,7 @@ struct Prototype : Module { // Add extension if user didn't specify one std::string newExt = system::getExtension(newPath); if (newExt == "") - newPath += "." + ext; + newPath += ext; // Write and close file { @@ -594,7 +594,7 @@ struct Prototype : Module { if (path == "") return ""; // HACK check if extension is .pd - if (system::getExtension(path) == "pd") + if (system::getExtension(path) == ".pd") return settingsPdEditorPath; return settingsEditorPath; } diff --git a/src/PythonEngine.cpp b/src/PythonEngine.cpp index edcb0ec..022699f 100644 --- a/src/PythonEngine.cpp +++ b/src/PythonEngine.cpp @@ -252,5 +252,5 @@ struct PythonEngine : ScriptEngine { __attribute__((constructor(1000))) static void constructor() { - addScriptEngine("py"); + addScriptEngine(".py"); } diff --git a/src/QuickJSEngine.cpp b/src/QuickJSEngine.cpp index d137d9b..b1de404 100644 --- a/src/QuickJSEngine.cpp +++ b/src/QuickJSEngine.cpp @@ -329,5 +329,5 @@ struct QuickJSEngine : ScriptEngine { __attribute__((constructor(1000))) static void constructor() { - addScriptEngine("js"); + addScriptEngine(".js"); } diff --git a/src/SuperColliderEngine.cpp b/src/SuperColliderEngine.cpp index 6db72b1..910c0df 100644 --- a/src/SuperColliderEngine.cpp +++ b/src/SuperColliderEngine.cpp @@ -405,6 +405,6 @@ bool SC_VcvPrototypeClient::copyArrayOfFloatArrays(const PyrSlot& inSlot, const __attribute__((constructor(1000))) static void constructor() { - addScriptEngine("sc"); - addScriptEngine("scd"); + addScriptEngine(".sc"); + addScriptEngine(".scd"); } diff --git a/src/VultEngine.cpp b/src/VultEngine.cpp index 4370f53..d911aa7 100644 --- a/src/VultEngine.cpp +++ b/src/VultEngine.cpp @@ -150,5 +150,5 @@ struct VultEngine : ScriptEngine { __attribute__((constructor(1000))) static void constructor() { - addScriptEngine("vult"); + addScriptEngine(".vult"); } From 1bd7942c8e875c88ea2ad8345fc9a47f1b014581 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Sat, 25 Feb 2023 10:23:29 +0200 Subject: [PATCH 02/12] Updates the location of the Vult compiler code. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c1e56bb..c80e398 100644 --- a/Makefile +++ b/Makefile @@ -195,7 +195,7 @@ SOURCES += src/VultEngine.cpp vult := dep/vult/vultc.h $(vult): cd dep && mkdir -p vult - cd dep/vult && $(WGET) "https://github.com/modlfo/vult/releases/download/v0.4.12/vultc.h" + cd dep/vult && $(WGET) "https://github.com/vult-dsp/vult/releases/download/v0.4.12/vultc.h" $(SHA256) $(vult) 3e80f6d30defe7df2804568f0314dbb33e6bf69d53d18a804c8b8132cf5ad146 FLAGS += -Idep/vult DEPS += $(vult) @@ -224,7 +224,7 @@ endif $(libpd): cd dep && git clone "https://github.com/libpd/libpd.git" --recursive cd dep/libpd && git checkout 5772a612527f06597d44d195843307ad0e3578fe - + ifdef ARCH_MAC # libpd's Makefile is handmade, and it doesn't honor CFLAGS and LDFLAGS environments. # So in order for Mac 10.15 (for example) to make a build that works on Mac 10.7+, we have to manually add DEP_MAC_SDK_FLAGS to CFLAGS and LDFLAGS. From 7f7199ebf70321a989715922ceeb245ca9a81573 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Sat, 25 Feb 2023 10:42:19 +0200 Subject: [PATCH 03/12] Fixes Vult engine. --- src/VultEngine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VultEngine.cpp b/src/VultEngine.cpp index d911aa7..b90ae72 100644 --- a/src/VultEngine.cpp +++ b/src/VultEngine.cpp @@ -11,7 +11,7 @@ // Special version of createScriptEngine that only creates Lua engines ScriptEngine* createLuaEngine() { - auto it = scriptEngineFactories.find("lua"); + auto it = scriptEngineFactories.find(".lua"); if (it == scriptEngineFactories.end()) return NULL; return it->second->createScriptEngine(); @@ -119,7 +119,7 @@ struct VultEngine : ScriptEngine { JSValue luacode = JS_GetPropertyStr(ctx, first, "code"); std::string luacode_str(JS_ToCString(ctx, luacode)); - //WARN("Generated Code: %s", luacode_str.c_str()); + WARN("Generated Code: %s", luacode_str.c_str()); luaEngine = createLuaEngine(); From f55a07dd80982529edf6bb878caab24f3cab3e68 Mon Sep 17 00:00:00 2001 From: Leonardo Laguna Ruiz Date: Sat, 25 Feb 2023 12:24:58 +0200 Subject: [PATCH 04/12] Fixes LuaJIT engine on Mac OS. In order to make LuaJIT work on Mac it is necessary to update to LuaJIT 2.1. --- Makefile | 20 ++++++++++++++------ src/LuaJITEngine.cpp | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c80e398..af8cc9d 100644 --- a/Makefile +++ b/Makefile @@ -29,11 +29,20 @@ endif # Entropia File System Watcher +ifeq (, $(shell which premake4)) + ifeq (, $(shell which premake5)) + $(error premake is not installed. Please install either premake4 or premake5) + else + PREMAKE = premake5 + endif +else + PREMAKE = premake4 +endif efsw := dep/lib/libefsw-static-release.a DEPS += $(efsw) OBJECTS += $(efsw) $(efsw): - cd efsw && premake4 gmake + cd efsw && $(PREMAKE) gmake cd efsw && $(MAKE) -C make/* config=release efsw-static-lib mkdir -p dep/lib dep/include cd efsw && cp lib/libefsw-static-release.a $(DEP_PATH)/lib/ @@ -74,14 +83,13 @@ endif # LuaJIT ifeq ($(LUAJIT), 1) SOURCES += src/LuaJITEngine.cpp -luajit := dep/lib/libluajit-5.1.a +luajit := dep/LuaJIT/src/libluajit.a OBJECTS += $(luajit) DEPS += $(luajit) $(luajit): - $(WGET) "http://luajit.org/download/LuaJIT-2.0.5.tar.gz" - $(SHA256) LuaJIT-2.0.5.tar.gz 874b1f8297c697821f561f9b73b57ffd419ed8f4278c82e05b48806d30c1e979 - cd dep && $(UNTAR) ../LuaJIT-2.0.5.tar.gz - cd dep/LuaJIT-2.0.5 && $(MAKE) BUILDMODE=static PREFIX="$(DEP_PATH)" install + cd dep && git clone "https://github.com/LuaJIT/LuaJIT.git" + cd dep/LuaJIT && git checkout v2.1 + cd dep/LuaJIT && MACOSX_DEPLOYMENT_TARGET=10.9 $(MAKE) BUILDMODE=static PREFIX="$(DEP_PATH)" install endif diff --git a/src/LuaJITEngine.cpp b/src/LuaJITEngine.cpp index a2167a6..df1fb59 100644 --- a/src/LuaJITEngine.cpp +++ b/src/LuaJITEngine.cpp @@ -1,5 +1,5 @@ #include "ScriptEngine.hpp" -#include +#include struct LuaJITEngine : ScriptEngine { From 017f843de7303a5e68f2c95cd345cb7bbd39a77e Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sat, 25 Feb 2023 15:17:58 +0000 Subject: [PATCH 05/12] [makefile] Update Vult header URL Using the v2 branch as this is the current version of VCV Rack --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index af8cc9d..18383b1 100644 --- a/Makefile +++ b/Makefile @@ -203,8 +203,8 @@ SOURCES += src/VultEngine.cpp vult := dep/vult/vultc.h $(vult): cd dep && mkdir -p vult - cd dep/vult && $(WGET) "https://github.com/vult-dsp/vult/releases/download/v0.4.12/vultc.h" - $(SHA256) $(vult) 3e80f6d30defe7df2804568f0314dbb33e6bf69d53d18a804c8b8132cf5ad146 + cd dep/vult && $(WGET) "https://github.com/vult-dsp/vult/releases/download/v0.4.14/vultc.h" + $(SHA256) $(vult) cf12bbb57feafc29fba6e6567d6c93e743e1aa761a56670f4049c920a02fc56a FLAGS += -Idep/vult DEPS += $(vult) endif From 96d6305e89af82a39fb96578d2d25ac5d10f9ed1 Mon Sep 17 00:00:00 2001 From: Leonardo Laguna Ruiz Date: Sat, 25 Feb 2023 17:33:45 +0200 Subject: [PATCH 06/12] Fixes compilation of efsw on Windows. --- Makefile | 12 +++++++++++- src/Prototype.cpp | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index af8cc9d..6bb9914 100644 --- a/Makefile +++ b/Makefile @@ -38,14 +38,24 @@ ifeq (, $(shell which premake4)) else PREMAKE = premake4 endif -efsw := dep/lib/libefsw-static-release.a +ifdef ARCH_WIN + efsw := dep/lib/efsw-static-release.lib +else + efsw := dep/lib/libefsw-static-release.a +endif DEPS += $(efsw) OBJECTS += $(efsw) $(efsw): cd efsw && $(PREMAKE) gmake +ifdef ARCH_WIN + cd efsw && $(MAKE) -C make/* config=release_x86_64 efsw-static-lib + mkdir -p dep/lib dep/include + cd efsw && cp lib/efsw-static-release.lib $(DEP_PATH)/lib/ +else cd efsw && $(MAKE) -C make/* config=release efsw-static-lib mkdir -p dep/lib dep/include cd efsw && cp lib/libefsw-static-release.a $(DEP_PATH)/lib/ +endif cd efsw && cp -R include/efsw $(DEP_PATH)/include/ diff --git a/src/Prototype.cpp b/src/Prototype.cpp index afb18c6..70c4d44 100644 --- a/src/Prototype.cpp +++ b/src/Prototype.cpp @@ -504,7 +504,7 @@ struct Prototype : Module { (void) std::system(command.c_str()); #elif defined ARCH_WIN std::string command = editorPath + " \"" + path + "\""; - std::wstring commandW = string::toWstring(command); + std::wstring commandW = string::UTF8toUTF16(command); STARTUPINFOW startupInfo; std::memset(&startupInfo, 0, sizeof(startupInfo)); startupInfo.cb = sizeof(startupInfo); From ac2b9f42c219fba46c74d8b92bde55c0b086ffe5 Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sat, 25 Feb 2023 15:51:58 +0000 Subject: [PATCH 07/12] [makefile] Update supercollider to v3.13 Updated PR #59 Conversation https://github.com/VCVRack/VCV-Prototype/pull/59#issuecomment-923900319 still relevant --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index af8cc9d..1f4a4bd 100644 --- a/Makefile +++ b/Makefile @@ -104,8 +104,8 @@ DEPS += $(supercollider) DISTRIBUTABLES += dep/supercollider/SCClassLibrary DISTRIBUTABLES += support/supercollider_extensions SUPERCOLLIDER_CMAKE_FLAGS += -DSUPERNOVA=0 -DSC_EL=0 -DSC_VIM=0 -DSC_ED=0 -DSC_IDE=0 -DSC_ABLETON_LINK=0 -DSC_QT=0 -DCMAKE_BUILD_TYPE=Release -DSCLANG_SERVER=0 -DBUILD_TESTING=0 -DNO_LIBSNDFILE=1 -SUPERCOLLIDER_SUBMODULES += external_libraries/hidapi external_libraries/nova-simd external_libraries/nova-tt external_libraries/portaudio_sc_org external_libraries/yaml-cpp -SUPERCOLLIDER_BRANCH := topic/vcv-prototype-support +SUPERCOLLIDER_SUBMODULES += external_libraries/hidapi external_libraries/nova-simd external_libraries/nova-tt external_libraries/portaudio/portaudio_submodule external_libraries/yaml-cpp +SUPERCOLLIDER_BRANCH := 3.13 OBJECTS += dep/supercollider/build/external_libraries/libtlsf.a OBJECTS += dep/supercollider/build/external_libraries/hidapi/linux/libhidapi.a @@ -120,7 +120,7 @@ LDFLAGS += -lpthread -lasound -ludev $(supercollider): cd dep && git clone "https://github.com/supercollider/supercollider" --branch $(SUPERCOLLIDER_BRANCH) --depth 1 - cd dep/supercollider && git checkout 84b14d10d49edce6dd8303045a884fb7f2bc92e8 + cd dep/supercollider && git checkout c64c5244c5e7bbcb26a829e9cf72d249a529c213 cd dep/supercollider && git submodule update --depth 1 --init -- $(SUPERCOLLIDER_SUBMODULES) cd dep/supercollider && mkdir build cd dep/supercollider/build && $(CMAKE) .. $(SUPERCOLLIDER_CMAKE_FLAGS) From ebdf8dfd3a6b83c3409ba6cd9fb8760b5b4983ca Mon Sep 17 00:00:00 2001 From: Leonardo Date: Sat, 25 Feb 2023 23:34:58 +0200 Subject: [PATCH 08/12] Avoids crashing Rack if the Vult compiler does not run correctly. --- src/VultEngine.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/VultEngine.cpp b/src/VultEngine.cpp index b90ae72..3bfd95d 100644 --- a/src/VultEngine.cpp +++ b/src/VultEngine.cpp @@ -26,7 +26,10 @@ struct VultEngine : ScriptEngine { JSRuntime* rt = NULL; JSContext* ctx = NULL; + bool js_failure; + VultEngine() { + js_failure = false; rt = JS_NewRuntime(); // Create QuickJS context ctx = JS_NewContext(rt); @@ -41,9 +44,11 @@ struct VultEngine : ScriptEngine { JSValue val = JS_Eval(ctx, (const char*)vultc_h, vultc_h_size, "vultc.js", 0); if (JS_IsException(val)) { - display("Error loading the Vult compiler"); + WARN("Error loading the Vult compiler"); + WARN("%s", JS_ToCString(ctx, JS_ToString(ctx,val))); JS_FreeValue(ctx, val); JS_FreeValue(ctx, global_obj); + js_failure = true; return; } } @@ -62,6 +67,11 @@ struct VultEngine : ScriptEngine { } int run(const std::string& path, const std::string& script) override { + if (js_failure) { + display("Error loading the Vult compiler"); + return -1; + } + display("Loading..."); JSValue global_obj = JS_GetGlobalObject(ctx); @@ -142,8 +152,8 @@ struct VultEngine : ScriptEngine { } int process() override { - if (!luaEngine) - return -1; + if (!luaEngine || js_failure) + return -1; return luaEngine->process(); } }; From 7e79676c70d952ef3ae4b68aa1aa0e5ca05eeff2 Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sat, 25 Feb 2023 23:10:04 +0000 Subject: [PATCH 09/12] Update Vult to v0.4.15 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 18383b1..c8803d4 100644 --- a/Makefile +++ b/Makefile @@ -203,8 +203,8 @@ SOURCES += src/VultEngine.cpp vult := dep/vult/vultc.h $(vult): cd dep && mkdir -p vult - cd dep/vult && $(WGET) "https://github.com/vult-dsp/vult/releases/download/v0.4.14/vultc.h" - $(SHA256) $(vult) cf12bbb57feafc29fba6e6567d6c93e743e1aa761a56670f4049c920a02fc56a + cd dep/vult && $(WGET) "https://github.com/vult-dsp/vult/releases/download/v0.4.15/vultc.h" + $(SHA256) $(vult) 5c5e6c7c92caacc10dacd8e4dd5e8134b520e630562e1f928ab1332218266638 FLAGS += -Idep/vult DEPS += $(vult) endif From 1594197df4f159cc28415639b7791e4347def713 Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sun, 26 Feb 2023 00:02:47 +0000 Subject: [PATCH 10/12] Update PureData (libPD) to v0.13.2 Thanks to @dizzisound https://github.com/VCVRack/VCV-Prototype/issues/66#issuecomment-1430090584 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b814ab3..2d535f9 100644 --- a/Makefile +++ b/Makefile @@ -226,7 +226,7 @@ libpd := dep/lib/libpd.a SOURCES += src/LibPDEngine.cpp OBJECTS += $(libpd) DEPS += $(libpd) -FLAGS += -Idep/include/libpd -DHAVE_LIBDL +FLAGS += -Idep/include/libpd -DHAVE_LIBDL -DPDINSTANCE -DPDTHREADS ifdef ARCH_WIN # PD_INTERNAL leaves the function declarations for libpd unchanged @@ -241,7 +241,7 @@ endif $(libpd): cd dep && git clone "https://github.com/libpd/libpd.git" --recursive - cd dep/libpd && git checkout 5772a612527f06597d44d195843307ad0e3578fe + cd dep/libpd && git checkout e3980d2fe45ef9eaaec1d45e4d68637eaf76a8b1 ifdef ARCH_MAC # libpd's Makefile is handmade, and it doesn't honor CFLAGS and LDFLAGS environments. From 3de4a7e756426f108b72e8744ae5ea7abb7bb94e Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sun, 26 Feb 2023 19:34:53 +0000 Subject: [PATCH 11/12] [make] (WIP) Fix Supercollider engine on Windows ```make dep``` build works on Windows. Currently the ```make dist``` step for the SC engine part of the module fails. Can be built successfully on Mac, Linux untested. --- Makefile | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 2d535f9..5d7e4f7 100644 --- a/Makefile +++ b/Makefile @@ -106,9 +106,13 @@ endif # SuperCollider ifeq ($(SUPERCOLLIDER), 1) SOURCES += src/SuperColliderEngine.cpp -FLAGS += -Idep/supercollider/include -Idep/supercollider/include/common -Idep/supercollider/lang -Idep/supercollider/common -Idep/supercollider/include/plugin_interface +FLAGS += -Idep/supercollider/include -Idep/supercollider/include/common -Idep/supercollider/lang -Idep/supercollider/common -Idep/supercollider/include/plugin_interface -Idep/supercollider/external_libraries/boost # FLAGS += -DSC_VCV_ENGINE_TIMING # uncomment to turn on timing printing while running -supercollider := dep/supercollider/build/lang/libsclang.a +ifdef ARCH_WIN + supercollider := dep/supercollider/build/lang/liblibsclang.a +else + supercollider := dep/supercollider/build/lang/libsclang.a +endif OBJECTS += $(supercollider) DEPS += $(supercollider) DISTRIBUTABLES += dep/supercollider/SCClassLibrary @@ -117,16 +121,28 @@ SUPERCOLLIDER_CMAKE_FLAGS += -DSUPERNOVA=0 -DSC_EL=0 -DSC_VIM=0 -DSC_ED=0 -DSC_I SUPERCOLLIDER_SUBMODULES += external_libraries/hidapi external_libraries/nova-simd external_libraries/nova-tt external_libraries/portaudio/portaudio_submodule external_libraries/yaml-cpp SUPERCOLLIDER_BRANCH := 3.13 -OBJECTS += dep/supercollider/build/external_libraries/libtlsf.a -OBJECTS += dep/supercollider/build/external_libraries/hidapi/linux/libhidapi.a +ifdef ARCH_WIN + OBJECTS += dep/supercollider/build/external_libraries/hidapi/windows/libhidapi.a +endif +ifdef ARCH_LIN + OBJECTS += dep/supercollider/build/external_libraries/hidapi/linux/libhidapi.a +endif +ifdef ARCH_MAC + OBJECTS += dep/supercollider/build/external_libraries/hidapi/mac/libhidapi.a +endif OBJECTS += dep/supercollider/build/external_libraries/hidapi/hidapi_parser/libhidapi_parser.a OBJECTS += dep/supercollider/build/external_libraries/libboost_thread_lib.a OBJECTS += dep/supercollider/build/external_libraries/libboost_system_lib.a OBJECTS += dep/supercollider/build/external_libraries/libboost_regex_lib.a OBJECTS += dep/supercollider/build/external_libraries/libboost_filesystem_lib.a +OBJECTS += dep/supercollider/build/external_libraries/libtlsf.a OBJECTS += dep/supercollider/build/external_libraries/libyaml.a -LDFLAGS += -lpthread -lasound -ludev +ifdef ARCH_LIN + LDFLAGS += -lpthread -lasound -ludev +else + LDFLAGS += -lpthread +endif $(supercollider): cd dep && git clone "https://github.com/supercollider/supercollider" --branch $(SUPERCOLLIDER_BRANCH) --depth 1 From 73052e16a1cc948f876ccef94b72c892f4e24fa9 Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Mon, 27 Feb 2023 01:54:50 +0000 Subject: [PATCH 12/12] Fix Faust engine on Windows --- src/FaustEngine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/FaustEngine.cpp b/src/FaustEngine.cpp index 3803c8c..39008b2 100644 --- a/src/FaustEngine.cpp +++ b/src/FaustEngine.cpp @@ -29,6 +29,10 @@ #include #include #include +#if defined ARCH_WIN +#include +#include +#endif #pragma GCC diagnostic push #ifndef __clang__ @@ -250,7 +254,7 @@ public: std::string temp_cache = "/tmp/VCVPrototype_" + generateSHA1(script); #elif defined ARCH_WIN char buf[MAX_PATH + 1] = {0}; - GetTempPath(sizeof(buf), buf); + GetTempPathA(sizeof(buf), buf); std::string temp_cache = std::string(buf) + "/VCVPrototype_" + generateSHA1(script); #endif std::string error_msg;