summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Bucher <johannes.bucher2@student.kit.edu>2019-12-13 13:54:17 +0100
committerJohannes Bucher <johannes.bucher2@student.kit.edu>2019-12-13 13:54:17 +0100
commit915fb9a661ea8e291e678961f9f1e857433c03cf (patch)
treeffc0d3575908ec6f90fef3db3806cd296e36692c
parentf9a9fc7dc7c74ead22e15b1be6ce6f990219f45f (diff)
Fix build scripts for MINGW environments
-rw-r--r--CMakeLists.txt4
-rw-r--r--Makefile1
2 files changed, 3 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6bc6bfb..57f337e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -452,8 +452,8 @@ set(BUILD_SHARED_LIBS Off CACHE BOOL "whether to build shared libraries")
add_library(firm ${SOURCES})
if(UNIX)
target_link_libraries(firm LINK_PUBLIC m)
-elseif(WIN32)
- target_link_libraries(firm LINK_PUBLIC gnurx winmm)
+elseif(WIN32 OR MINGW)
+ target_link_libraries(firm LINK_PUBLIC regex winmm)
endif()
enable_testing()
diff --git a/Makefile b/Makefile
index 087e5e4..58501a9 100644
--- a/Makefile
+++ b/Makefile
@@ -53,6 +53,7 @@ PICFLAG ?= -fPIC
CFLAGS += $(CFLAGS_$(variant)) -std=c99 $(PICFLAG) -DHAVE_FIRM_REVISION_H
CFLAGS += -Wall -W -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings
LINKFLAGS += $(LINKFLAGS_$(variant)) -lm
+LINKFLAGS += $(if $(filter %cygwin %mingw32, $(shell $(CC) $(CFLAGS) -dumpmachine)), -lregex -lwinmm,)
VPATH = $(srcdir) $(gendir)
all: firm