From 0cfd3bc20d44be52c78fb8370d94a949dccc2600 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 5 Feb 2019 13:43:30 -0800 Subject: [PATCH] Make Windows build link to libstdc++ etc. --- Makefile | 34 ++++++++++++++++------------------ plugin.mk | 6 +++--- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index a1f5754e..624851f7 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,17 @@ SOURCES += dep/osdialog/osdialog.c SOURCES += $(wildcard dep/jpommier-pffft-*/pffft.c) $(wildcard dep/jpommier-pffft-*/fftpack.c) SOURCES += $(wildcard src/*.cpp src/*/*.cpp) +ifdef ARCH_LIN + SOURCES += dep/osdialog/osdialog_gtk2.c + CFLAGS += $(shell pkg-config --cflags gtk+-2.0) + LDFLAGS += -rdynamic \ + -Ldep/lib \ + -Wl,-Bstatic -lglfw3 -lGLEW -ljansson -lspeexdsp -lzip -lz -lrtmidi -lrtaudio -lcurl -lssl -lcrypto \ + -Wl,-Bdynamic -lpthread -lGL -ldl -lX11 -lasound -ljack \ + $(shell pkg-config --libs gtk+-2.0) + TARGET := Rack +endif + ifdef ARCH_MAC SOURCES += dep/osdialog/osdialog_mac.m LDFLAGS += -lpthread -ldl \ @@ -27,26 +38,13 @@ endif ifdef ARCH_WIN SOURCES += dep/osdialog/osdialog_win.c - LDFLAGS += -static \ - -Wl,--export-all-symbols,--out-implib,libRack.a -mwindows \ - -Ldep/lib -lglew32 -lglfw3 -ljansson -lspeexdsp -lzip -lz -lcurl -lssl -lcrypto -lrtaudio -lrtmidi \ + LDFLAGS += -Wl,--export-all-symbols,--out-implib,libRack.a -mwindows \ + dep/lib/libglew32.a dep/lib/libglfw3.a dep/lib/libjansson.a dep/lib/libspeexdsp.a dep/lib/libzip.a dep/lib/libz.a dep/lib/libcurl.a dep/lib/libssl.a dep/lib/libcrypto.a dep/lib/librtaudio.a dep/lib/librtmidi.a \ -lpthread -lopengl32 -lgdi32 -lws2_32 -lcomdlg32 -lole32 -ldsound -lwinmm -lksuser -lshlwapi -lmfplat -lmfuuid -lwmcodecdspuuid -ldbghelp TARGET := Rack.exe OBJECTS += Rack.res endif -ifdef ARCH_LIN - SOURCES += dep/osdialog/osdialog_gtk2.c - CFLAGS += $(shell pkg-config --cflags gtk+-2.0) - LDFLAGS += -rdynamic \ - -Ldep/lib \ - -Wl,-Bstatic -lglfw3 -lGLEW -ljansson -lspeexdsp -lzip -lz -lrtmidi -lrtaudio -lcurl -lssl -lcrypto \ - -Wl,-Bdynamic -lpthread -lGL -ldl -lX11 -lasound -ljack \ - $(shell pkg-config --libs gtk+-2.0) - TARGET := Rack -endif - - # Convenience targets all: $(TARGET) @@ -141,9 +139,9 @@ ifdef ARCH_WIN cp $(TARGET) dist/Rack/ $(STRIP) -s dist/Rack/$(TARGET) cp -R LICENSE* res template.vcv dist/Rack/ - # cp /mingw64/bin/libwinpthread-1.dll dist/Rack/ - # cp /mingw64/bin/libstdc++-6.dll dist/Rack/ - # cp /mingw64/bin/libgcc_s_seh-1.dll dist/Rack/ + cp /mingw64/bin/libwinpthread-1.dll dist/Rack/ + cp /mingw64/bin/libstdc++-6.dll dist/Rack/ + cp /mingw64/bin/libgcc_s_seh-1.dll dist/Rack/ cp plugins/Fundamental/dist/*.zip dist/Rack/Fundamental.zip # mkdir -p dist/Rack/Bridge # cp Bridge/VST/dist/VCV-Bridge-{32,64,fx-32,fx-64}.dll dist/Rack/Bridge/ diff --git a/plugin.mk b/plugin.mk index 0e634e8c..d8000e0b 100644 --- a/plugin.mk +++ b/plugin.mk @@ -2,8 +2,8 @@ ifndef RACK_DIR $(error RACK_DIR is not defined) endif -SLUG := $(shell jq ".slug" plugin.json) -VERSION := $(shell jq ".version" plugin.json) +SLUG := $(shell jq .slug plugin.json) +VERSION := $(shell jq .version plugin.json) DISTRIBUTABLES += plugin.json @@ -27,7 +27,7 @@ endif ifdef ARCH_WIN LDFLAGS += -shared -L$(RACK_DIR) -lRack TARGET := plugin.dll - RACK_USER_DIR ?= $(USERPROFILE)/Documents/Rack + RACK_USER_DIR ?= "$(USERPROFILE)"/Documents/Rack endif