Skip to content

Commit 42df39a

Browse files
author
Simon-L
committed
Update Makefile for cross-compiling liblo on mingw32
1 parent 57be1b0 commit 42df39a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,30 @@ $(losc): $(luajit)
3939
liblo := dep/lib/liblo.a
4040
OBJECTS += $(liblo)
4141
DEPS += $(liblo)
42-
$(liblo):
42+
$(liblo): $(losc)
4343
git clone https://github.com/radarsat1/liblo dep/liblo
44+
ifneq (,$(findstring x86_64-w64-mingw32,$(PATH)))
45+
cd dep/liblo && ./autogen.sh --host=x86_64-w64-mingw32 CFLAGS="-Wno-error=unused-variable" --prefix="$(DEP_PATH)" --enable-static=yes --enable-shared=no --disable-tests --disable-network-tests --disable-tools --disable-examples
46+
else
4447
cd dep/liblo && ./autogen.sh --prefix="$(DEP_PATH)" --enable-static=yes --enable-shared=no --disable-tests --disable-network-tests --disable-tools --disable-examples
48+
endif
4549
$(MAKE) -C dep/liblo
4650
$(MAKE) -C dep/liblo install
4751

4852
# Careful about linking to shared libraries, since you can't assume much about the user's environment and library search path.
4953
# Static libraries are fine, but they should be added to this plugin's build system.
50-
LDFLAGS +=
54+
ifneq (,$(findstring x86_64-w64-mingw32,$(PATH)))
55+
LDFLAGS += -lws2_32 -liphlpapi
56+
else
57+
LDFLAGS +=
58+
endif
5159

5260
# Add .cpp files to the build
5361
SOURCES += $(wildcard src/*.cpp)
5462

5563
# Add files to the ZIP package when running `make dist`
5664
# The compiled plugin and "plugin.json" are automatically added.
57-
DISTRIBUTABLES += res scripts/*.lua scripts/apcmini.lua scripts/lib/*
65+
DISTRIBUTABLES += res scripts/*.lua scripts/lib/*
5866
DISTRIBUTABLES += $(wildcard LICENSE*)
5967
DISTRIBUTABLES += $(wildcard presets)
6068

0 commit comments

Comments
 (0)