Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Faust engine on Windows #76

Open
wants to merge 2 commits into
base: v2-tmp
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/FaustEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#include <vector>
#include <algorithm>
#include <functional>
#if defined ARCH_WIN
#include <fileapi.h>
#include <windef.h>
#endif

#pragma GCC diagnostic push
#ifndef __clang__
Expand Down Expand Up @@ -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;
Expand Down