mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 20:05:36 +00:00
4ca5ea5b7e
Downstream distributors can use this to mark a version with their preferred version information, like a Linux distribution package version or the Steam revision it was built to be bundled into, or just to mark it with the vendor it was built by or the environment it's intended to be used in. For instance, in Debian I'd use this by configuring with: --enable-vendor-info="${DEB_VENDOR} ${DEB_VERSION}" to get a SDL_REVISION like: release-2.24.1-0-ga1d1946dc (Debian 2.24.1+dfsg-2) which gives a Debian user enough information to track down the patches and build-time configuration that were used for package revision 2. In Autotools and CMake, this is a configure-time option like any other, and will go into both SDL_REVISION (via SDL_revision.h) and SDL_GetRevision(). In other build systems (MSVC, Xcode, etc.), defining the SDL_VENDOR_INFO macro will get it into the output of SDL_GetRevision(), although not SDL_REVISION. Resolves: https://github.com/libsdl-org/SDL/issues/6418 Signed-off-by: Simon McVittie <smcv@collabora.com>
75 lines
3.1 KiB
YAML
75 lines
3.1 KiB
YAML
name: Build (MSVC)
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
Build:
|
|
name: ${{ matrix.platform.name }}
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform:
|
|
- { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64' }
|
|
- { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32' }
|
|
- { name: Windows static VCRT (x64), flags: -A x64 -DSDL_FORCE_STATIC_VCRT=ON }
|
|
- { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON }
|
|
- { name: Windows (clang-cl x64), flags: -T ClangCL -A x64 }
|
|
- { 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_TESTS=OFF, nowerror: true,
|
|
project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' }
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Create CMake project using SDL as a subproject
|
|
shell: python
|
|
run: |
|
|
import os
|
|
import textwrap
|
|
srcdir = r"${{ github.workspace }}".replace("\\", "/")
|
|
builddir = f"{ srcdir }/build"
|
|
os.makedirs(builddir)
|
|
with open(f"{ builddir }/CMakeLists.txt", "w") as f:
|
|
f.write(textwrap.dedent(f"""\
|
|
cmake_minimum_required(VERSION 3.0)
|
|
project(sdl_user)
|
|
add_subdirectory("{ srcdir }" SDL)
|
|
"""))
|
|
- name: Configure (CMake)
|
|
run: cmake -S build -B build `
|
|
-DSDL_WERROR=${{ !matrix.platform.nowerror }} `
|
|
-DSDL_TESTS=ON `
|
|
-DSDL_INSTALL_TESTS=ON `
|
|
-DSDL_VENDOR_INFO="Github Workflow" `
|
|
-DSDL2_DISABLE_INSTALL=OFF `
|
|
${{ matrix.platform.flags }} `
|
|
-DCMAKE_INSTALL_PREFIX=prefix
|
|
- name: Build (CMake)
|
|
run: cmake --build build/ --config Release --parallel
|
|
- name: Run build-time tests
|
|
if: "! contains(matrix.platform.name, 'ARM')"
|
|
run: |
|
|
$env:SDL_TESTS_QUICK=1
|
|
ctest -VV --test-dir build/ -C Release
|
|
- 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 != '' }}
|
|
uses: microsoft/setup-msbuild@v1.0.2
|
|
- name: Build msbuild
|
|
if: ${{ matrix.platform.project != '' }}
|
|
run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }}
|