Skip to content

Commit

Permalink
UGLY hack to fix the MSW builds
Browse files Browse the repository at this point in the history
Closes: #4
Related: festvox/flite#83
  • Loading branch information
umlaeute committed Nov 8, 2022
1 parent 2a12267 commit 9af1e16
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
lib.name = flite

cflags =
w32_cflags =

BUNDLED_FLITE = ./deps/flite
ifneq ($(wildcard $(BUNDLED_FLITE)/include/flite.h),)
Expand Down Expand Up @@ -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 += \
Expand Down Expand Up @@ -288,7 +305,7 @@ define forWindows
cflags += \
-DCST_NO_SOCKETS \
-DUNDER_WINDOWS \
-DWIN32 \
$(w32_cflags) \
$(empty)
ldlibs +=
endef
Expand Down

0 comments on commit 9af1e16

Please sign in to comment.