summaryrefslogtreecommitdiff
path: root/.gitlab-ci
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2021-03-23 11:10:20 +0000
committerJose Fonseca <jfonseca@vmware.com>2021-03-24 06:51:46 +0000
commit0f9e7d995a14f15666600fc8598f941b619d82fe (patch)
treed2caafad9dd8c029a57e2fcba106cb73f0320fa2 /.gitlab-ci
parentfaaa319d704ac677c3a93caadedeb91a4a74b7a7 (diff)
gitlab-ci: Add MinGW build job.
A rudimentary job, just to ensure Windows builds don't go south. The FreeGLUT dependencies are derived from the Linux headers plus a .def file, to avoid any further downloads whatsoever. v2: Quote all bash variable expansions and treat unset vars as errors, per Eric Engestrom.
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x.gitlab-ci/build-mingw.sh40
-rw-r--r--.gitlab-ci/freeglut.def154
-rw-r--r--.gitlab-ci/mingw32.cmake8
3 files changed, 202 insertions, 0 deletions
diff --git a/.gitlab-ci/build-mingw.sh b/.gitlab-ci/build-mingw.sh
new file mode 100755
index 00000000..26233d33
--- /dev/null
+++ b/.gitlab-ci/build-mingw.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+if [ -d /usr/lib/ccache ]
+then
+ export PATH="/usr/lib/ccache:$PATH"
+fi
+
+set -e -x -u
+
+GLUT_INCLUDE_DIR="$PWD/external/freeglut/include"
+GLUT_LIBRARY="$PWD/external/freeglut/lib/libfreeglut.a"
+if [ ! -f "$GLUT_INCLUDE_DIR/GL/glut.h" ]
+then
+ mkdir -p "$GLUT_INCLUDE_DIR/GL"
+ for header in GL/glut.h GL/freeglut.h GL/freeglut_std.h GL/freeglut_ext.h
+ do
+ cp -av "/usr/include/$header" "$GLUT_INCLUDE_DIR/$header"
+ done
+fi
+if [ ! -f "$GLUT_LIBRARY" ]
+then
+ mkdir -p external/freeglut/lib
+ i686-w64-mingw32-dlltool --kill-at --def .gitlab-ci/freeglut.def --output-lib "$GLUT_LIBRARY"
+fi
+
+cmake \
+ -S . \
+ -B build/mingw32 \
+ -G "Ninja" \
+ -DCMAKE_TOOLCHAIN_FILE=.gitlab-ci/mingw32.cmake \
+ -DCMAKE_BUILD_TYPE=Debug \
+ -DCMAKE_INSTALL_PREFIX=publish/mingw32 \
+ -DGLUT_INCLUDE_DIR="$GLUT_INCLUDE_DIR" \
+ -DGLUT_glut_LIBRARY="$GLUT_LIBRARY" \
+ -DGLUT_glut_LIBRARY_DEBUG="$GLUT_LIBRARY" \
+ -DGLUT_glut_LIBRARY_RELEASE="$GLUT_LIBRARY"
+
+cmake --build build/mingw32
+
+cmake --build build/mingw32 --target install
diff --git a/.gitlab-ci/freeglut.def b/.gitlab-ci/freeglut.def
new file mode 100644
index 00000000..f49e6c13
--- /dev/null
+++ b/.gitlab-ci/freeglut.def
@@ -0,0 +1,154 @@
+LIBRARY "freeglut.dll"
+EXPORTS
+__glutCreateMenuWithExit@8
+__glutCreateWindowWithExit@8
+__glutInitWithExit@12
+glutAddMenuEntry@8
+glutAddSubMenu@8
+glutAttachMenu@4
+glutBitmapCharacter@8
+glutBitmapHeight@4
+glutBitmapLength@8
+glutBitmapString@8
+glutBitmapWidth@8
+glutButtonBoxFunc@4
+glutChangeToMenuEntry@12
+glutChangeToSubMenu@12
+glutCloseFunc@4
+glutCopyColormap@4
+glutCreateMenu@4
+glutCreateSubWindow@20
+glutCreateWindow@4
+glutDestroyMenu@4
+glutDestroyWindow@4
+glutDetachMenu@4
+glutDeviceGet@4
+glutDialsFunc@4
+glutDisplayFunc@4
+glutEnterGameMode@0
+glutEntryFunc@4
+glutEstablishOverlay@0
+glutExit@0
+glutExtensionSupported@4
+glutForceJoystickFunc@0
+glutFullScreen@0
+glutFullScreenToggle@0
+glutGameModeGet@4
+glutGameModeString@4
+glutGet@4
+glutGetColor@8
+glutGetMenu@0
+glutGetMenuData@0
+glutGetModeValues@8
+glutGetModifiers@0
+glutGetProcAddress@4
+glutGetWindow@0
+glutGetWindowData@0
+glutHideOverlay@0
+glutHideWindow@0
+glutIconifyWindow@0
+glutIdleFunc@4
+glutIgnoreKeyRepeat@4
+glutInit@8
+glutInitContextFlags@4
+glutInitContextProfile@4
+glutInitContextVersion@8
+glutInitDisplayMode@4
+glutInitDisplayString@4
+glutInitErrorFunc@4
+glutInitWarningFunc@4
+glutInitWindowPosition@8
+glutInitWindowSize@8
+glutJoystickFunc@8
+glutKeyboardFunc@4
+glutKeyboardUpFunc@4
+glutLayerGet@4
+glutLeaveFullScreen@0
+glutLeaveGameMode@0
+glutLeaveMainLoop@0
+glutMainLoop@0
+glutMainLoopEvent@0
+glutMenuDestroyFunc@4
+glutMenuStateFunc@4
+glutMenuStatusFunc@4
+glutMotionFunc@4
+glutMouseFunc@4
+glutMouseWheelFunc@4
+glutMultiButtonFunc@4
+glutMultiEntryFunc@4
+glutMultiMotionFunc@4
+glutMultiPassiveFunc@4
+glutOverlayDisplayFunc@4
+glutPassiveMotionFunc@4
+glutPopWindow@0
+glutPositionWindow@8
+glutPostOverlayRedisplay@0
+glutPostRedisplay@0
+glutPostWindowOverlayRedisplay@4
+glutPostWindowRedisplay@4
+glutPushWindow@0
+glutRemoveMenuItem@4
+glutRemoveOverlay@0
+glutReportErrors@0
+glutReshapeFunc@4
+glutReshapeWindow@8
+glutSetColor@16
+glutSetCursor@4
+glutSetIconTitle@4
+glutSetKeyRepeat@4
+glutSetMenu@4
+glutSetMenuData@4
+glutSetOption@8
+glutSetWindow@4
+glutSetWindowData@4
+glutSetWindowTitle@4
+glutSetupVideoResizing@0
+glutShowOverlay@0
+glutShowWindow@0
+glutSolidCone@24
+glutSolidCube@8
+glutSolidCylinder@24
+glutSolidDodecahedron@0
+glutSolidIcosahedron@0
+glutSolidOctahedron@0
+glutSolidRhombicDodecahedron@0
+glutSolidSierpinskiSponge@16
+glutSolidSphere@16
+glutSolidTeapot@8
+glutSolidTetrahedron@0
+glutSolidTorus@24
+glutSpaceballButtonFunc@4
+glutSpaceballMotionFunc@4
+glutSpaceballRotateFunc@4
+glutSpecialFunc@4
+glutSpecialUpFunc@4
+glutStopVideoResizing@0
+glutStrokeCharacter@8
+glutStrokeHeight@4
+glutStrokeLength@8
+glutStrokeString@8
+glutStrokeWidth@8
+glutSwapBuffers@0
+glutTabletButtonFunc@4
+glutTabletMotionFunc@4
+glutTimerFunc@12
+glutUseLayer@4
+glutVideoPan@16
+glutVideoResize@16
+glutVideoResizeGet@4
+glutVisibilityFunc@4
+glutWMCloseFunc@4
+glutWarpPointer@8
+glutWindowStatusFunc@4
+glutWireCone@24
+glutWireCube@8
+glutWireCylinder@24
+glutWireDodecahedron@0
+glutWireIcosahedron@0
+glutWireOctahedron@0
+glutWireRhombicDodecahedron@0
+glutWireSierpinskiSponge@16
+glutWireSphere@16
+glutWireTeapot@8
+glutWireTetrahedron@0
+glutWireTorus@24
diff --git a/.gitlab-ci/mingw32.cmake b/.gitlab-ci/mingw32.cmake
new file mode 100644
index 00000000..79dc4ec3
--- /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)