Commit 5f1c91499486c97bcd176102549a03564a33a129

Silvio Traversaro 2020-12-13T01:29:18

Merge pull request #88 from pali/master Run Travis tests also under i586-mingw32msvc-gcc compiler

diff --git a/.travis.yml b/.travis.yml
index 4df8ce7..ebc6834 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,5 +15,18 @@ env:
   - ci_buildsys=cmake
   - ci_buildsys=Makefile
 
+jobs:
+  include:
+    - dist: trusty
+      compiler: i586-mingw32msvc-gcc
+      addons:
+        apt:
+          packages:
+            - mingw32
+            - wine
+      env: ci_buildsys=Makefile
+      # Check that we have a real i586-mingw32msvc-gcc compiler as sometimes it is just a symlink to i686-w64-mingw32-gcc
+      before_script: "i586-mingw32msvc-gcc -v 2>&1 | grep -q -x 'Target: i586-mingw32msvc'"
+
 script:
   - ci_target=${CC%-*} ./tools/ci-build.sh
diff --git a/tools/ci-build.sh b/tools/ci-build.sh
index a7d79b1..366a407 100755
--- a/tools/ci-build.sh
+++ b/tools/ci-build.sh
@@ -11,8 +11,6 @@ set -x
 # target to build for
 : "${ci_target:=${CROSS_COMPILE%-}}"
 
-install_prefix=$(${ci_target}-gcc --print-sysroot)/${ci_target}
-
 case "$ci_buildsys" in
     (Makefile)
         ./configure --enable-shared --enable-static --enable-wine --cross-prefix=${ci_target}-
@@ -27,7 +25,7 @@ case "$ci_buildsys" in
         cd build
         cmake \
             --no-warn-unused-cli                         \
-            -DCMAKE_FIND_ROOT_PATH=$install_prefix       \
+            -DCMAKE_FIND_ROOT_PATH=$(${ci_target}-gcc --print-sysroot)/${ci_target}       \
             -DCMAKE_BUILD_TYPE=RelWithDebInfo            \
             -DCMAKE_C_COMPILER=$(which ${ci_target}-gcc) \
             -DCMAKE_SYSTEM_PROCESSOR=${ci_target%-*-*}   \