]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
CI: Factor out Wine setup so that it applies equally to Meson
authorSimon McVittie <smcv@collabora.com>
Fri, 24 Jun 2022 16:21:00 +0000 (17:21 +0100)
committerSimon McVittie <smcv@collabora.com>
Wed, 13 Jul 2022 19:36:13 +0000 (20:36 +0100)
Signed-off-by: Simon McVittie <smcv@collabora.com>
tools/ci-build.sh

index 86da12824d0fada827fe7e74d414b3d1366519d3..b04f04130de64ba4280cd5723363ddf9c437613d 100755 (executable)
@@ -231,6 +231,22 @@ esac
 
 cd "$builddir"
 
+case "$ci_host" in
+    (*-w64-mingw32)
+        # If we're dynamically linking libgcc, make sure Wine will find it
+        if [ "$ci_test" = yes ]; then
+            if [ "${ci_distro%%-*}" = opensuse ] && [ "${ci_host%%-*}" = x86_64 ]; then
+                export WINEARCH=win64
+            fi
+            libgcc_path=
+            if [ "$ci_runtime" = "shared" ]; then
+                libgcc_path=$(dirname "$("${ci_host}-gcc" -print-libgcc-file-name)")
+            fi
+            init_wine "${dep_prefix}/bin" "${builddir}/bin" ${libgcc_path:+"$libgcc_path"}
+        fi
+        ;;
+esac
+
 make="make -j${ci_parallel} V=1 VERBOSE=1"
 
 case "$ci_buildsys" in
@@ -379,22 +395,12 @@ case "$ci_buildsys" in
             (*-w64-mingw32)
                 # CFLAGS and CXXFLAGS does do work, checked with cmake 3.15
                 export LDFLAGS="-${ci_runtime}-libgcc"
-                # enable tests if supported
-                if [ "$ci_test" = yes ]; then
-                    # choose correct wine architecture
-                    if [ "${ci_distro%%-*}" = opensuse ]; then
-                        if [ "${ci_host%%-*}" = x86_64 ]; then
-                            export WINEARCH=win64
-                            cmake=mingw64-cmake
-                        else
-                            cmake=mingw32-cmake
-                        fi
-                    fi
-                    libgcc_path=
-                    if [ "$ci_runtime" = "shared" ]; then
-                        libgcc_path=$(dirname "$("${ci_host}-gcc" -print-libgcc-file-name)")
+                if [ "${ci_distro%%-*}" = opensuse ]; then
+                    if [ "${ci_host%%-*}" = x86_64 ]; then
+                        cmake=mingw64-cmake
+                    else
+                        cmake=mingw32-cmake
                     fi
-                    init_wine "${dep_prefix}/bin" "$(pwd)/bin" ${libgcc_path:+"$libgcc_path"}
                     cmdwrapper="xvfb-run -a"
                 fi
                 set _ "$@"