shithub: cstory

Download patch

ref: 91f71d4030a1b1e7835a9589bd66454dedf406ec
parent: a20b906257f661b4c7efe465718b281c9678805d
author: Clownacy <Clownacy@users.noreply.github.com>
date: Thu Jan 23 11:57:58 EST 2020

Try to split 32-bit/64-bit builds

--- a/.travis.yml
+++ b/.travis.yml
@@ -28,6 +28,8 @@
 env:
     - MAKE_BUILD_TYPE=RELEASE=0
     - MAKE_BUILD_TYPE=RELEASE=1
+    - SIXTY_FOUR_BIT=false
+    - SIXTY_FOUR_BIT=true
 
 before_install:
     # Setup MSYS2
@@ -40,10 +42,17 @@
             export msys2='cmd //C RefreshEnv.cmd '
             export msys2+='& set MSYS=winsymlinks:nativestrict '
             export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
-            export mingw32="$msys2 -mingw32 -full-path -here -c "\"\$@"\" --"
-            export mingw64="$msys2 -mingw64 -full-path -here -c "\"\$@"\" --"
+            if [ "$SIXTY_FOUR_BIT" == "true" ]; then
+                export mingw="$msys2 -mingw64 -full-path -here -c "\"\$@"\" --"
+            else
+                export mingw="$msys2 -mingw32 -full-path -here -c "\"\$@"\" --"
+            fi
             export msys2+=" -msys2 -c "\"\$@"\" --"
-            $msys2 pacman --sync --noconfirm --needed make mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain
+            if [ "$SIXTY_FOUR_BIT" == "true" ]; then
+                $msys2 pacman --sync --noconfirm --needed make mingw-w64-x86_64-toolchain
+            else
+                $msys2 pacman --sync --noconfirm --needed make mingw-w64-i686-toolchain
+            fi
             taskkill //IM gpg-agent.exe //F  # https://travis-ci.community/t/4967
             export PATH=/C/tools/msys64/mingw64/bin:$PATH
             export MAKE=mingw32-make  # so that Autotools can find it
@@ -63,35 +72,33 @@
     # Display build type
     - echo $MAKE_BUILD_TYPE
 
+	# Define CC and CXX
+    if ["$SIXTY_FOUR_BIT" == "true"
+      export CC="x86_64-w64-mingw32-gcc"
+      export CXX="x86_64-w64-mingw32-g++"
+    else
+      export CC="i686-w64-mingw32-gcc"
+      export CXX="i686-w64-mingw32-g++"
+    fi
+
     # Define WINDRES
     - |
       if [ "$TRAVIS_OS_NAME" = "windows" ]; then
-        WINDRES32="windres"
-        WINDRES64="windres"
+        export WINDRES="windres"
       else
-        WINDRES32="i686-w64-mingw32-windres"
-        WINDRES64="x86_64-w64-mingw32-windres"
+        if ["$SIXTY_FOUR_BIT" == "true"
+          export WINDRES="x86_64-w64-mingw32-windres"
+        else
+          export WINDRES="i686-w64-mingw32-windres"
+        fi
       fi
 
     # Display compilers name/version
-    - |
-      if [ "$TRAVIS_OS_NAME" = "windows" ]; then
-        $mingw32 echo ${CC}
-        $mingw32 echo ${CXX}
-        $mingw32 ${CC} --version
-        $mingw32 ${CXX} --version
+    $mingw echo ${CC}
+    $mingw echo ${CXX}
+    $mingw ${CC} --version
+    $mingw ${CXX} --version
 
-        $mingw64 echo ${CC}
-        $mingw64 echo ${CXX}
-        $mingw64 ${CC} --version
-        $mingw64 ${CXX} --version
-      else
-        echo ${CC}
-        echo ${CXX}
-        ${CC} --version
-        ${CXX} --version
-      fi
-
 before_cache:
     - |-
         case $TRAVIS_OS_NAME in
@@ -114,11 +121,8 @@
     - echo $JOBS
 
 script:
-    # Compile 32-bit build
-    - $mingw32 make -j ${JOBS} FIX_BUGS=1 ${MAKE_BUILD_TYPE} WARNINGS=1 WARNINGS_ALL=1 WINDOWS=1 STATIC=1 CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ WINDRES=${WINDRES32}
-
-    # Compile 64-bit build
-    - $mingw64 make -j ${JOBS} FIX_BUGS=1 ${MAKE_BUILD_TYPE} WARNINGS=1 WARNINGS_ALL=1 WINDOWS=1 STATIC=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ WINDRES=${WINDRES64}
+    # Build
+    - $mingw make -j ${JOBS} FIX_BUGS=1 ${MAKE_BUILD_TYPE} WARNINGS=1 WARNINGS_ALL=1 WINDOWS=1 STATIC=1
 
 after_success:
     # Send success notification to Discord through DISCORD_WEBHOOK_URL