ci: test installed packages using CMake
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml
index 04372bf..9380efa 100644
--- a/.github/workflows/emscripten.yml
+++ b/.github/workflows/emscripten.yml
@@ -11,6 +11,21 @@ jobs:
with:
version: 2.0.27
- name: Configure CMake
- run: emcmake cmake -B build -DCMAKE_VERBOSE_MAKEFILE=ON
+ run: |
+ emcmake cmake -S . -B build \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=prefix
- name: Build
- run: cmake --build build/
+ run: cmake --build build/ --verbose
+ - name: Install
+ run: |
+ echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
+ cmake --install build/
+ - name: Verify CMake configuration files
+ if: ${{ false }} # FIXME: cmake/test/CMakeLists.txt should support emscripten
+ run: |
+ emcmake cmake -S cmake/test -B cmake_config_build \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DTEST_SHARED=FALSE \
+ -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
+ cmake --build cmake_config_build --verbose
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9f8d83d..1837433 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -17,9 +17,10 @@ jobs:
platform:
- { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
- - { name: Linux (CMake), os: ubuntu-20.04, shell: sh, flags: -GNinja }
- - { name: Linux (autotools), os: ubuntu-20.04, shell: sh, autotools: 'true' }
- - { name: MacOS, os: macos-latest, shell: sh }
+ - { name: Linux (CMake), os: ubuntu-20.04, shell: sh, flags: true }
+ - { name: Linux (autotools), os: ubuntu-20.04, shell: sh, autotools: true }
+ - { name: MacOS (CMake), os: macos-latest, shell: sh }
+ - { name: MacOS (autotools), os: macos-latest, shell: sh, autotools: true }
steps:
- name: Set up MSYS2
@@ -79,78 +80,105 @@ jobs:
meson build --buildtype release -Ddemo=false -Ddbus=disabled
ninja -v -C build
sudo meson install -C build
+ - name: Setup Macos dependencies
+ if: runner.os == 'macOS'
+ run: |
+ brew install \
+ ninja
- uses: actions/checkout@v2
- name: Check that versioning is consistent
# We only need to run this once: arbitrarily use the Linux/CMake build
if: "runner.os == 'Linux' && ! matrix.platform.autotools"
run: ./test/versioning.sh
- - name: Configure CMake
+ - name: Configure (CMake)
if: "! matrix.platform.autotools"
- run: cmake -B build -DSDL_TEST=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DSDL_INSTALL_TESTS=ON ${{ matrix.platform.flags }}
- - name: Build
+ run: |
+ cmake -S . -B build -G Ninja \
+ -DSDL_TESTS=ON \
+ -DSDL_INSTALL_TESTS=ON \
+ -DCMAKE_INSTALL_PREFIX=cmake_prefix \
+ -DCMAKE_BUILD_TYPE=Release
+ - name: Build (CMake)
if: "! matrix.platform.autotools"
- run: cmake --build build/ --config Release
- - name: Run build-time tests
+ run: |
+ cmake --build build/ --config Release --verbose --parallel
+ - name: Run build-time tests (CMake)
if: "matrix.platform.shell == 'sh' && ! matrix.platform.autotools"
run: |
set -eu
export SDL_TESTS_QUICK=1
ctest -VV --test-dir build/
- - name: Install
- if: "matrix.platform.shell == 'sh' && ! matrix.platform.autotools"
+ - name: Install (CMake)
+ if: "! matrix.platform.autotools"
run: |
set -eu
- rm -fr DESTDIR-cmake
- DESTDIR=$(pwd)/DESTDIR-cmake cmake --install build/ --config Release
- ( cd DESTDIR-cmake; find ) | LC_ALL=C sort -u
- - name: Configure Autotools
+ cmake --install build/ --config Release
+ echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV
+ ( cd cmake_prefix; find ) | LC_ALL=C sort -u
+ - name: Configure (Autotools)
if: matrix.platform.autotools
run: |
set -eu
rm -fr build-autotools
mkdir build-autotools
./autogen.sh
- ( cd build-autotools && ../configure )
- curdir="$(pwd)"
- multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
(
- mkdir -p build-autotools/test
- cd build-autotools/test
- ../../test/configure \
- --x-includes=/usr/include \
- --x-libraries="/usr/lib/${multiarch}" \
- SDL_CFLAGS="-I${curdir}/include" \
- SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \
- ac_cv_lib_SDL2_ttf_TTF_Init=no \
- ${NULL+}
+ cd build-autotools
+ ${{ github.workspace }}/configure \
+ --prefix=${{ github.workspace }}/autotools_prefix \
)
- - name: Build with Autotools
+ if test "${{ runner.os }}" != "macOS" ; then
+ curdir="$(pwd)"
+ multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
+ (
+ mkdir -p build-autotools/test
+ cd build-autotools/test
+ ${{ github.workspace }}/test/configure \
+ --x-includes=/usr/include \
+ --x-libraries="/usr/lib/${multiarch}" \
+ --prefix=${{ github.workspace }}/autotools_prefix \
+ SDL_CFLAGS="-I${curdir}/include" \
+ SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \
+ ac_cv_lib_SDL2_ttf_TTF_Init=no \
+ ${NULL+}
+ )
+ fi
+ - name: Build (Autotools)
if: matrix.platform.autotools
run: |
set -eu
parallel="$(getconf _NPROCESSORS_ONLN)"
make -j"${parallel}" -C build-autotools V=1
- make -j"${parallel}" -C build-autotools/test V=1
- - name: Run build-time tests with Autotools
- if: matrix.platform.autotools
+ if test "${{ runner.os }}" != "macOS" ; then
+ make -j"${parallel}" -C build-autotools/test V=1
+ fi
+ - name: Run build-time tests (Autotools)
+ if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }}
run: |
set -eu
curdir="$(pwd)"
parallel="$(getconf _NPROCESSORS_ONLN)"
export SDL_TESTS_QUICK=1
make -j"${parallel}" -C build-autotools/test check LD_LIBRARY_PATH="${curdir}/build-autotools/build/.libs"
- - name: Install with Autotools
+ - name: Install (Autotools)
if: matrix.platform.autotools
run: |
set -eu
curdir="$(pwd)"
parallel="$(getconf _NPROCESSORS_ONLN)"
- rm -fr DESTDIR-autotools
- mkdir DESTDIR-autotools
- make -j"${parallel}" -C build-autotools install DESTDIR="${curdir}/DESTDIR-autotools" V=1
- make -j"${parallel}" -C build-autotools/test install DESTDIR="${curdir}/DESTDIR-autotools" V=1
- ( cd DESTDIR-autotools; find ) | LC_ALL=C sort -u
- - name: Distcheck
+ make -j"${parallel}" -C build-autotools install V=1
+ if test "${{ runner.os }}" != "macOS" ; then
+ make -j"${parallel}" -C build-autotools/test install V=1
+ fi
+ ( cd autotools_prefix; find . ) | LC_ALL=C sort -u
+ echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV
+ - name: Verify CMake configuration files
+ run: |
+ cmake -S cmake/test -B cmake_config_build -G Ninja \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
+ cmake --build cmake_config_build --verbose
+ - name: Distcheck (Autotools)
if: matrix.platform.autotools
run: |
set -eu
@@ -162,7 +190,7 @@ jobs:
tar -C distcheck -zxf build-autotools/SDL2-*.tar.gz
( cd distcheck/SDL2-* && ./configure )
make -j"${parallel}" -C distcheck/SDL2-*
- - name: Run installed-tests from Autotools
+ - name: Run installed-tests (Autotools)
if: "runner.os == 'Linux' && matrix.platform.autotools"
run: |
set -eu
diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml
index 39e23e4..1db6a39 100644
--- a/.github/workflows/msvc.yml
+++ b/.github/workflows/msvc.yml
@@ -19,14 +19,29 @@ jobs:
- { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 }
- { name: Windows (ARM), flags: -A ARM }
- { name: Windows (ARM64), flags: -A ARM64 }
- - { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TEST=OFF, project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' }
+ - { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF,
+ project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' }
steps:
- uses: actions/checkout@v2
- name: Configure CMake
- run: cmake -B build -DSDL_TEST=ON ${{ matrix.platform.flags }}
+ run: cmake -S . -B build `
+ -DSDL_TESTS=ON `
+ ${{ matrix.platform.flags }} `
+ -DCMAKE_INSTALL_PREFIX=prefix
- name: Build CMake
run: cmake --build build/ --config Release --parallel
+ - name: Install CMake
+ run: |
+ echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
+ cmake --install build/
+ - name: Verify CMake configuration files
+ if: ${{ !contains(matrix.platform.name, 'UWP') }} # FIXME: cmake/test/CMakeLists.txt should support UWP
+ run: |
+ cmake -S cmake/test -B cmake_config_build `
+ -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} `
+ ${{ matrix.platform.flags }}
+ cmake --build cmake_config_build --config Release
- name: Add msbuild to PATH
if: ${{ matrix.platform.project != '' }}
diff --git a/.github/workflows/psp.yaml b/.github/workflows/psp.yaml
index b1b470e..bed0a01 100644
--- a/.github/workflows/psp.yaml
+++ b/.github/workflows/psp.yaml
@@ -13,6 +13,24 @@ jobs:
apk update
apk add cmake gmp mpc1 mpfr4 make
- name: Configure CMake
- run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake -DSDL_TEST=ON
+ run: |
+ cmake -S . -B build \
+ -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
+ -DSDL_TESTS=ON \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=prefix
- name: Build
- run: cmake --build build
+ run: cmake --build build --config Release
+ - name: Install
+ run: |
+ echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
+ cmake --install build --config Release
+ ( cd prefix; find ) | LC_ALL=C sort -u
+ - name: Verify CMake configuration files
+ run: |
+ cmake -S cmake/test -B cmake_config_build \
+ -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
+ -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
+ -DTEST_SHARED=FALSE \
+ -DCMAKE_BUILD_TYPE=Release
+ cmake --build cmake_config_build --verbose
diff --git a/.github/workflows/riscos.yml b/.github/workflows/riscos.yml
index 9f33705..7c3340c 100644
--- a/.github/workflows/riscos.yml
+++ b/.github/workflows/riscos.yml
@@ -3,26 +3,63 @@ name: Build (RISC OS)
on: [push, pull_request]
jobs:
- autotools:
- name: autotools
+ Build:
+ name: ${{ matrix.platform.name }}
runs-on: ubuntu-latest
container: riscosdotinfo/riscos-gccsdk-4.7:latest
- steps:
- - uses: actions/checkout@v2
- - name: Configure
- run: ./configure --host=arm-unknown-riscos --disable-gcc-atomics
- - name: Build
- run: make -j`nproc` V=1
- cmake:
- name: CMake
- runs-on: ubuntu-latest
- container: riscosdotinfo/riscos-gccsdk-4.7:latest
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - { name: autotools, test_args: '-DTEST_SHARED=FALSE' } # FIXME: autotools should build and install shared libraries
+ - { name: CMake }
+
steps:
- name: Setup dependencies
run: apt-get update && apt-get install -y cmake ninja-build
- uses: actions/checkout@v2
- - name: Configure CMake
- run: cmake -S. -Bbuild -G Ninja -DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake -DRISCOS=ON -DSDL_GCC_ATOMICS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON
- - name: Build
- run: cmake --build build
+ - name: Configure (autotools)
+ if: ${{ contains(matrix.platform.name, 'autotools') }}
+ run: |
+ mkdir build_autotools
+ cd build_autotools
+ ../configure \
+ --host=arm-unknown-riscos \
+ --disable-gcc-atomics \
+ --prefix=${{ github.workspace }}/prefix_autotools
+ - name: Build (autotools)
+ if: ${{ contains(matrix.platform.name, 'autotools') }}
+ run: make -C build_autotools -j`nproc` V=1
+ - name: Install (autotools)
+ if: ${{ contains(matrix.platform.name, 'autotools') }}
+ run: |
+ echo "SDL2_DIR=${{ github.workspace }}/prefix_autotools" >> $GITHUB_ENV
+ make -C build_autotools install
+ ( cd ${{ github.workspace }}/prefix_autotools; find ) | LC_ALL=C sort -u
+ - name: Configure (CMake)
+ if: ${{ contains(matrix.platform.name, 'CMake') }}
+ run: |
+ cmake -S . -B build -G Ninja \
+ -DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \
+ -DRISCOS=ON \
+ -DSDL_GCC_ATOMICS=OFF \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/prefix_cmake
+ - name: Build (CMake)
+ if: ${{ contains(matrix.platform.name, 'CMake') }}
+ run: cmake --build build --verbose
+ - name: Install (CMake)
+ if: ${{ contains(matrix.platform.name, 'CMake') }}
+ run: |
+ echo "SDL2_DIR=${{ github.workspace }}/prefix_cmake" >> $GITHUB_ENV
+ cmake --install build/
+ ( cd ${{ github.workspace }}/prefix_cmake; find ) | LC_ALL=C sort -u
+ - name: Verify CMake configuration files
+ run: |
+ cmake -S cmake/test -B cmake_config_build -G Ninja \
+ -DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \
+ -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
+ -DCMAKE_BUILD_TYPE=Release \
+ ${{ matrix.platform.test_args }}
+ cmake --build cmake_config_build --verbose
diff --git a/.github/workflows/vita.yaml b/.github/workflows/vita.yaml
index 49d1a2b..792bd5b 100644
--- a/.github/workflows/vita.yaml
+++ b/.github/workflows/vita.yaml
@@ -16,8 +16,25 @@ jobs:
- name: Install CMake and GNU Make
run: |
apk update
- apk add cmake make
+ apk add cmake make ninja
- name: Configure CMake
- run: cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=Release
+ run: |
+ cmake -S . -B build -G Ninja \
+ -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=prefix
- name: Build
- run: cmake --build build
+ run: cmake --build build --verbose
+ - name: Install CMake
+ run: |
+ echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
+ cmake --install build/
+ ( cd prefix; find ) | LC_ALL=C sort -u
+ - name: Verify CMake configuration files
+ run: |
+ cmake -S cmake/test -B cmake_config_build -G Ninja \
+ -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
+ -DTEST_SHARED=FALSE \
+ -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
+ -DCMAKE_BUILD_TYPE=Release
+ cmake --build cmake_config_build --verbose