Commit cb3c668c authored by Jose Fonseca's avatar Jose Fonseca Committed by Emil Velikov
Browse files

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's avatarErik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov's avatarEmil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 6c28e5f1)
parent 65e2bc71
Pipeline #285353 passed with stages
in 1 minute and 3 seconds
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
......
#!/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
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)
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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment