From 0f9959a15b6dee0d3a84e195e5bb8718d03ea225 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 30 Mar 2020 20:37:38 -0500 Subject: [PATCH] build.sh: Only find the mingw compiler on Windows. Fixes #2269 --- build.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/build.sh b/build.sh index fd6587267d..bd204e3f3a 100755 --- a/build.sh +++ b/build.sh @@ -154,21 +154,24 @@ clang_version_ok() { } set_cc() { - # on Cygwin we MUST use the MinGW "cross-compiler", therefore check these first # furthermore, we prefer 64 bit over 32 bit versions if both are available - test_programs_installed x86_64-w64-mingw32-gcc x86_64-w64-mingw32-g++ - if [[ $? -ne 0 ]] ; then - [ -z "$CC" ] && CC=x86_64-w64-mingw32-gcc - [ -z "$CXX" ] && CXX=x86_64-w64-mingw32-g++ - return - fi - test_programs_installed i686-w64-mingw32-gcc i686-w64-mingw32-g++ - if [[ $? -ne 0 ]] ; then - [ -z "$CC" ] && CC=i686-w64-mingw32-gcc - [ -z "$CXX" ] && CXX=i686-w64-mingw32-g++ - return + # we need this condition so we don't find a mingw32 compiler on linux + if [[ $OS == windows ]] ; then + test_programs_installed x86_64-w64-mingw32-gcc x86_64-w64-mingw32-g++ + if [[ $? -ne 0 ]] ; then + [ -z "$CC" ] && CC=x86_64-w64-mingw32-gcc + [ -z "$CXX" ] && CXX=x86_64-w64-mingw32-g++ + return + fi + + test_programs_installed i686-w64-mingw32-gcc i686-w64-mingw32-g++ + if [[ $? -ne 0 ]] ; then + [ -z "$CC" ] && CC=i686-w64-mingw32-gcc + [ -z "$CXX" ] && CXX=i686-w64-mingw32-g++ + return + fi fi test_programs_installed clang clang++ -- 2.34.1