diff options
Diffstat (limited to 'src/contrib/SDL-2.30.2/.github/workflows/msvc.yml')
-rw-r--r-- | src/contrib/SDL-2.30.2/.github/workflows/msvc.yml | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/src/contrib/SDL-2.30.2/.github/workflows/msvc.yml b/src/contrib/SDL-2.30.2/.github/workflows/msvc.yml new file mode 100644 index 0000000..241cc55 --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/msvc.yml | |||
@@ -0,0 +1,80 @@ | |||
1 | name: Build (MSVC) | ||
2 | |||
3 | on: [push, pull_request] | ||
4 | |||
5 | jobs: | ||
6 | Build: | ||
7 | name: ${{ matrix.platform.name }} | ||
8 | runs-on: windows-latest | ||
9 | |||
10 | strategy: | ||
11 | fail-fast: false | ||
12 | matrix: | ||
13 | platform: | ||
14 | - { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64' } | ||
15 | - { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32' } | ||
16 | - { name: Windows static VCRT (x64), flags: -A x64 -DSDL_FORCE_STATIC_VCRT=ON } | ||
17 | - { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON } | ||
18 | - { name: Windows (clang-cl x64), flags: -T ClangCL -A x64 } | ||
19 | - { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 } | ||
20 | - { name: Windows (ARM), flags: -A ARM } | ||
21 | - { name: Windows (ARM64), flags: -A ARM64 } | ||
22 | - { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF, nowerror: true, | ||
23 | project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' } | ||
24 | |||
25 | steps: | ||
26 | - uses: actions/checkout@v4 | ||
27 | - name: Create CMake project using SDL as a subproject | ||
28 | shell: python | ||
29 | run: | | ||
30 | import os | ||
31 | import textwrap | ||
32 | srcdir = r"${{ github.workspace }}".replace("\\", "/") | ||
33 | builddir = f"{ srcdir }/build" | ||
34 | os.makedirs(builddir) | ||
35 | with open(f"{ builddir }/CMakeLists.txt", "w") as f: | ||
36 | f.write(textwrap.dedent(f"""\ | ||
37 | # Always build .PDB symbol file | ||
38 | set(CMAKE_POLICY_DEFAULT_CMP0141 "NEW" CACHE STRING "MSVC debug information format flags are selected by an abstraction") | ||
39 | set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "MSVC debug information format") | ||
40 | set(CMAKE_EXE_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flags for executables") | ||
41 | set(CMAKE_SHARED_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flag for shared libraries") | ||
42 | cmake_minimum_required(VERSION 3.0...3.25) | ||
43 | project(sdl_user) | ||
44 | enable_testing() | ||
45 | add_subdirectory("{ srcdir }" SDL) | ||
46 | """)) | ||
47 | - name: Configure (CMake) | ||
48 | run: cmake -S build -B build ` | ||
49 | -DSDL_WERROR=${{ !matrix.platform.nowerror }} ` | ||
50 | -DSDL_TESTS=ON ` | ||
51 | -DSDL_INSTALL_TESTS=ON ` | ||
52 | -DSDL_VENDOR_INFO="Github Workflow" ` | ||
53 | -DSDL2_DISABLE_INSTALL=OFF ` | ||
54 | ${{ matrix.platform.flags }} ` | ||
55 | -DCMAKE_INSTALL_PREFIX=prefix | ||
56 | - name: Build (CMake) | ||
57 | run: cmake --build build/ --config Release --parallel | ||
58 | - name: Run build-time tests | ||
59 | if: "! contains(matrix.platform.name, 'ARM')" | ||
60 | run: | | ||
61 | $env:SDL_TESTS_QUICK=1 | ||
62 | ctest -VV --test-dir build/ -C Release -j2 | ||
63 | - name: Install (CMake) | ||
64 | run: | | ||
65 | echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV | ||
66 | cmake --install build/ | ||
67 | - name: Verify CMake configuration files | ||
68 | if: ${{ !contains(matrix.platform.name, 'UWP') }} # FIXME: cmake/test/CMakeLists.txt should support UWP | ||
69 | run: | | ||
70 | cmake -S cmake/test -B cmake_config_build ` | ||
71 | -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} ` | ||
72 | ${{ matrix.platform.flags }} | ||
73 | cmake --build cmake_config_build --config Release | ||
74 | |||
75 | - name: Add msbuild to PATH | ||
76 | if: ${{ matrix.platform.project != '' }} | ||
77 | uses: microsoft/setup-msbuild@v2 | ||
78 | - name: Build msbuild | ||
79 | if: ${{ matrix.platform.project != '' }} | ||
80 | run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }} | ||