-
Notifications
You must be signed in to change notification settings - Fork 14
82 lines (80 loc) · 2.71 KB
/
CMake-MSVC.yml
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
name: CMake MSVC
on: push
jobs:
yasm:
runs-on: windows-latest
steps:
- name: Restore yasm
id: restore-yasm
uses: actions/cache/restore@v4
with:
path: |
${{ github.workspace }}/yasm
key: yasm
- name: Download yasm sources
if: ${{ !steps.restore-yasm.outputs.cache-hit }}
uses: actions/checkout@v4
with:
repository: yasm/yasm
path: yasm-src
- name: Setup vcvars
if: ${{ !steps.restore-yasm.outputs.cache-hit }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Setup ninja
if: ${{ !steps.restore-yasm.outputs.cache-hit }}
uses: ./.github/actions/setup-ninja
- name: Build and install yasm
if: ${{ !steps.restore-yasm.outputs.cache-hit }}
run: |
cmake -S yasm-src -B yasm-build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/yasm -DCMAKE_INSTALL_LIBDIR=bin -DCMAKE_INSTALL_BINDIR=bin -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
cmake --build yasm-build --parallel
cmake --install yasm-build
- name: Cache yasm
if: ${{ !steps.restore-yasm.outputs.cache-hit }}
uses: actions/cache/save@v3
with:
path: |
${{ github.workspace }}/yasm
key: yasm
build:
defaults:
run:
shell: cmd
needs:
yasm
strategy:
fail-fast: false
matrix:
# currently windows-latest==windows-2022
# windows-2022: VS2022
# windows-2019: VS2019
os: [windows-2022, windows-2019]
arch: [x86, x64, amd64_arm, amd64_arm64]
shared: [ON, OFF]
yasm: [true, false]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Restore yasm
if: ${{ matrix.yasm }}
uses: actions/cache/restore@v4
with:
path: |
${{ github.workspace }}/yasm
key: yasm
- name: Add yasm to PATH
if: ${{ matrix.yasm }}
run: echo "${{ github.workspace }}/yasm/bin" >> %GITHUB_PATH%"
- name: Setup vcvars
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
sdK: ${{ (matrix.arch == 'amd64_arm' && '10.0.22621.0') || '' }}
- name: Setup ninja
uses: ./.github/actions/setup-ninja
- name: CMake (configure)
run: cmake -S ports/cmake -B build -GNinja ${{ (matrix.yasm && format('-DYASM_ASSEMBLER={0}/yasm/bin/vsyasm.exe', github.workspace)) || '' }} -DBUILD_SHARED_LIBS=${{ matrix.shared }}
- name: CMake (Build)
run: cmake --build build --verbose