Merge remote-tracking branch 'mpg123/master' into master-with-github-ci #272
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake MSVC | |
on: push | |
jobs: | |
yasm: | |
runs-on: windows-latest | |
steps: | |
- name: Restore yasm | |
id: restore-yasm | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
${{ github.workspace }}/yasm | |
key: yasm | |
- name: Download yasm sources | |
if: ${{ !steps.restore-yasm.outputs.cache-hit }} | |
uses: actions/checkout@v3 | |
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: Install ninja | |
if: ${{ !steps.restore-yasm.outputs.cache-hit }} | |
uses: turtlesec-no/get-ninja@main | |
- 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] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore yasm | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
${{ github.workspace }}/yasm | |
key: yasm | |
- name: Add yasm to PATH | |
run: echo "${{ github.workspace }}/yasm/bin" >> %GITHUB_PATH%" | |
- name: Setup vcvars | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Install ninja | |
uses: turtlesec-no/get-ninja@main | |
- name: CMake (configure) | |
run: cmake -S ports/cmake -B build -GNinja -DYASM_ASSEMBLER=${{ github.workspace }}/yasm/bin/vsyasm.exe -DBUILD_SHARED_LIBS=${{ matrix.shared }} | |
- name: CMake (Build) | |
run: cmake --build build --verbose |