Skip to content

Commit 1e8836d

Browse files
braichzamar
authored andcommitted
Fix compiling of 32 bit binary on 64-bit Windows
Two versions of mingw-w64 (targeting Win64 and Win32) can be installed on Windows too. No functional change Resolves official-stockfish#532
1 parent e3c85c3 commit 1e8836d

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

src/Makefile

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,22 +160,18 @@ endif
160160
ifeq ($(COMP),mingw)
161161
comp=mingw
162162

163-
ifeq ($(UNAME),Linux)
164-
ifeq ($(bits),64)
165-
ifeq ($(shell which x86_64-w64-mingw32-c++-posix),)
166-
CXX=x86_64-w64-mingw32-c++
167-
else
168-
CXX=x86_64-w64-mingw32-c++-posix
169-
endif
163+
ifeq ($(bits),64)
164+
ifeq ($(shell which x86_64-w64-mingw32-c++-posix),)
165+
CXX=x86_64-w64-mingw32-c++
170166
else
171-
ifeq ($(shell which i686-w64-mingw32-c++-posix),)
172-
CXX=i686-w64-mingw32-c++
173-
else
174-
CXX=i686-w64-mingw32-c++-posix
175-
endif
167+
CXX=x86_64-w64-mingw32-c++-posix
176168
endif
177169
else
178-
CXX=g++
170+
ifeq ($(shell which i686-w64-mingw32-c++-posix),)
171+
CXX=i686-w64-mingw32-c++
172+
else
173+
CXX=i686-w64-mingw32-c++-posix
174+
endif
179175
endif
180176

181177
CXXFLAGS += -Wextra -Wshadow

0 commit comments

Comments
 (0)