Skip to content

Commit

Permalink
Use "MSYS Makefiles" target when building on Windows
Browse files Browse the repository at this point in the history
Avoid using Visual Studio generator when building on Windows system by
using MSYS Makefiles generator on Microsoft Windows systems.

(Fix issue #83).

* Makefile: Conditionally use "MSYS Makefiles generator".  Also
  refactor the definition of build type by defining an
  CMAKE_CMD_LINE_OPTIONS variable.
  • Loading branch information
PierreTechoueyres authored and TheBB committed Dec 17, 2019
1 parent d587efc commit 622e3a1
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
CMAKE_CMD_LINE_OPTIONS=-DCMAKE_BUILD_TYPE=Debug

ifeq '$(findstring ;,$(PATH))' ';'
UNAME := Windows
else
UNAME := $(shell uname 2>/dev/null || echo Unknown)
UNAME := $(patsubst CYGWIN%,Cygwin,$(UNAME))
UNAME := $(patsubst MSYS%,MSYS,$(UNAME))
UNAME := $(patsubst MINGW%,MSYS,$(UNAME))
endif

ifeq ($(UNAME),MSYS)
CMAKE_CMD_LINE_OPTIONS+= -G "MSYS Makefiles"
endif

ifeq "$(TRAVIS)" "true"
## Makefile for Travis ###################################################
#
Expand All @@ -12,7 +27,7 @@ include emake.mk
build/libegit2.so:
git submodule update --init
mkdir -p build
cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug && make
cd build && cmake .. $(CMAKE_CMD_LINE_OPTIONS) && make

test: EMACS_ARGS += -L build/ -l libegit2
test: build/libegit2.so test-ert
Expand Down Expand Up @@ -51,7 +66,7 @@ module: build/libegit2.so
build/libegit2.so: libgit2
@printf "Building $<\n"
@mkdir -p build
@cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug && make
@cd build && cmake .. $(CMAKE_CMD_LINE_OPTIONS) && make

lisp: $(ELCS) loaddefs module

Expand Down

0 comments on commit 622e3a1

Please sign in to comment.