aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2021-03-08 10:59:13 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2021-03-15 18:59:28 +0000
commit6c28e5f1c018b2a972c8c3d35344df6af52ba579 (patch)
tree7ff2a60e69fca22dfa7c55be1dfb57f270542fb6
parent909c80861fa7131f5511898ef14f50b2625b9fc6 (diff)
downloadwaffle-6c28e5f1c018b2a972c8c3d35344df6af52ba579.tar.gz
gitlab-ci: Build and package with MinGW cross-compilers.
This produces artifacts which can be consumed by downstream piglit builds. Further changes can be done to restrict this to specific branches, tags, or even releases, as publishing artifacts on every build is likely overkill. Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
-rw-r--r--.gitlab-ci.yml14
-rwxr-xr-x.gitlab-ci/build-cmake-mingw.sh35
-rw-r--r--.gitlab-ci/mingw32.cmake8
-rw-r--r--.gitlab-ci/mingw64.cmake8
4 files changed, 64 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 735dc90..b03a24f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,6 @@
variables:
FDO_UPSTREAM_REPO: mesa/waffle
- FDO_DISTRIBUTION_TAG: '2021-01-26_2'
+ FDO_DISTRIBUTION_TAG: '2021-01-26_4'
FDO_DISTRIBUTION_VERSION: 'buster-slim'
include:
@@ -49,6 +49,7 @@ container:
libxcb1-dev
make
meson
+ mingw-w64
pkg-config
wayland-protocols
xauth
@@ -101,6 +102,17 @@ cmake:
- make -C _build check
- make -C _build install
+cmake-mingw:
+ extends:
+ - .build
+ script:
+ - .gitlab-ci/build-cmake-mingw.sh
+ # TODO: Only create artifacts on certain builds. See also:
+ # - https://docs.gitlab.com/ee/ci/yaml/README.html#artifactspaths
+ # - https://docs.gitlab.com/ee/ci/yaml/README.html#complete-example-for-release
+ artifacts:
+ paths:
+ - publish/*/waffle-*.zip
pages:
stage: www
diff --git a/.gitlab-ci/build-cmake-mingw.sh b/.gitlab-ci/build-cmake-mingw.sh
new file mode 100755
index 0000000..5dadfab
--- /dev/null
+++ b/.gitlab-ci/build-cmake-mingw.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+set -e -x
+
+export CMAKE_BUILD_PARALLEL_LEVEL=$(getconf _NPROCESSORS_ONLN)
+
+build() {
+ target=$1
+
+ cmake \
+ -S . \
+ -B _build/$target \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_INSTALL_PREFIX=publish/$target/waffle \
+ -DCMAKE_TOOLCHAIN_FILE=.gitlab-ci/$target.cmake \
+ -Dwaffle_build_tests=0 \
+ -Dwaffle_build_examples=1
+
+ cmake --build _build/$target
+
+ # XXX: Unfortunately the "package" target doesn't work for Windows, because
+ # cmake/Modules/GNUInstallDirs.cmake hardcodes absolute CMAKE_INSTALL_PREFIX
+ # into several CMAKE_INSTALL_* cached vars that don't get updated when
+ # installing to the archive scratch directory.
+
+ rm -rf publish/$target
+ cmake --build _build/$target --target install
+
+ pushd publish/$target
+ cmake -E tar cf waffle-$target.zip --format=zip waffle
+ popd
+}
+
+build mingw32
+build mingw64
diff --git a/.gitlab-ci/mingw32.cmake b/.gitlab-ci/mingw32.cmake
new file mode 100644
index 0000000..79dc4ec
--- /dev/null
+++ b/.gitlab-ci/mingw32.cmake
@@ -0,0 +1,8 @@
+set (CMAKE_SYSTEM_NAME Windows)
+set (CMAKE_C_COMPILER i686-w64-mingw32-gcc)
+set (CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
+set (CMAKE_RC_COMPILER i686-w64-mingw32-windres)
+set (CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
+set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/.gitlab-ci/mingw64.cmake b/.gitlab-ci/mingw64.cmake
new file mode 100644
index 0000000..36b920d
--- /dev/null
+++ b/.gitlab-ci/mingw64.cmake
@@ -0,0 +1,8 @@
+set (CMAKE_SYSTEM_NAME Windows)
+set (CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
+set (CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
+set (CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
+set (CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
+set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)