From 9af1e1693c858e927b8814eca873eacae5bd26bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 8 Nov 2022 10:45:08 +0100 Subject: [PATCH] UGLY hack to fix the MSW builds Closes: https://github.com/pd-externals/flite/issues/4 Related: https://github.com/festvox/flite/issues/83 --- Makefile | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f32c1f8..d39f165 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ lib.name = flite cflags = +w32_cflags = BUNDLED_FLITE = ./deps/flite ifneq ($(wildcard $(BUNDLED_FLITE)/include/flite.h),) @@ -41,6 +42,22 @@ cflags += -I $(BUNDLED_FLITE)/include \ -I $(BUNDLED_FLITE)/tools \ -I $(BUNDLED_FLITE)/wince \ $(empty) + +# urgh, this is ugly! +# we cannot really statically link against flite on Windows, +# as some global variables are declared with '__declspec(dllexport)'. +# so we just disable the entire __declspec() magic here: +w32_cflags += \ + -D"__declspec(x)=" \ + $(empty) + +# a much better approach is to just build a static version of flite, +# but this requires https://github.com/festvox/flite/pull/84 +# to be merged first: +w32_cflags += \ + -DFLITE_STATIC=1 \ + $(empty) + else cflags += -DHAVE_FLITE_FLITE_H=1 ldlibs += \ @@ -288,7 +305,7 @@ define forWindows cflags += \ -DCST_NO_SOCKETS \ -DUNDER_WINDOWS \ - -DWIN32 \ + $(w32_cflags) \ $(empty) ldlibs += endef