Skip to content
Snippets Groups Projects
Commit 5b57ae98 authored by stijn's avatar stijn Committed by Damien George
Browse files

mpy-cross: Fix compiler detection for including windows/fmode.c

fmode.c should only be included for builds targetting 'pure' windows, i.e.
msvc or mingw builds but not when using msys or cygwin's gcc (see #2298).
Just checking if the OS is windows and UNAME doesn't have msys stil leaves
the gate open for builds with cygwin's gcc since UNAME there is e.g.
CYGWIN_NT-6.1-WOW.
Fix this by checking for 'mingw' explicitly in the compiler version; both
gcc and clang have the -dumpmachine flag so the check should be ok for
all platforms.
parent 7d4ba9d2
Branches
No related tags found
No related merge requests found
......@@ -49,11 +49,11 @@ SRC_C = \
main.c \
gccollect.c \
ifeq ($(OS),Windows_NT)
ifeq (,$(findstring MSYS,$(UNAME_S)))
# Add fmode when compiling with mingw gcc
COMPILER_TARGET := $(shell $(CC) -dumpmachine)
ifneq (,$(findstring mingw,$(COMPILER_TARGET)))
SRC_C += windows/fmode.c
endif
endif
OBJ = $(PY_O)
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment