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 1/2] [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 2/2] 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 @@ class FaustEngine : public ScriptEngine { 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;