workflows: add Qt6 build using vcpkg

This commit is contained in:
David Hrdlička
2022-05-26 02:20:26 +02:00
parent 4c415d811c
commit ff2483cc3c

View File

@@ -104,7 +104,7 @@ jobs:
path: build/artifacts/** path: build/artifacts/**
llvm-windows: llvm-windows:
name: "Windows vcpkg/LLVM (${{ matrix.build.name }} ${{ matrix.target.name }})" name: "Windows vcpkg/LLVM (${{ matrix.ui.name }}, ${{ matrix.build.name }}, ${{ matrix.dynarec.name }}, ${{ matrix.target.name }})"
runs-on: windows-2022 runs-on: windows-2022
@@ -112,41 +112,28 @@ jobs:
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
strategy: strategy:
fail-fast: true fail-fast: false
matrix: matrix:
build: build:
# - name: Regular ODR - name: Debug
# slug: -ODR dev: off
# type: Release slug: -Debug
# dev-build: off - name: Dev
# new-dynarec: off dev: on
# strip: --strip slug: -Dev
- name: Debug ODR dynarec:
slug: -ODR-Debug - name: ODR
type: Debug new: off
dev-build: off slug: -ODR
new-dynarec: off - name: NDR
- name: Dev ODR new: on
slug: -ODR-Dev slug: -NDR
type: Debug ui:
dev-build: on - name: Win32 GUI
new-dynarec: off qt: off
# - name: Regular NDR - name: Qt GUI
# slug: -NDR qt: on
# type: Release slug: -Qt
# strip: --strip
# dev-build: off
# new-dynarec: on
- name: Debug NDR
slug: -NDR-Debug
type: Debug
dev-build: off
new-dynarec: on
- name: Dev NDR
slug: -NDR-Dev
type: Debug
dev-build: on
new-dynarec: on
target: target:
- name: x86 - name: x86
triplet: x86-windows-static triplet: x86-windows-static
@@ -161,13 +148,19 @@ jobs:
toolchain: cmake/llvm-win32-aarch64.cmake toolchain: cmake/llvm-win32-aarch64.cmake
vcvars: x64_arm64 vcvars: x64_arm64
exclude: exclude:
- build: - dynarec:
new-dynarec: off new: off
target: target:
name: ARM64 name: ARM64
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Prepare VS environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.target.vcvars }}
- name: Add LLVM to path
run: echo "C:/Program Files/LLVM/bin" >> $env:GITHUB_PATH
- name: Download Ninja - name: Download Ninja
run: > run: >
Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip -OutFile ninja-win.zip && Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip -OutFile ninja-win.zip &&
@@ -181,33 +174,33 @@ jobs:
-name "GitHub" -name "GitHub"
-username "86Box" -username "86Box"
-password "${{ secrets.GITHUB_TOKEN }}" -password "${{ secrets.GITHUB_TOKEN }}"
- run: dir "C:/Program Files/Microsoft Visual Studio/2022/*/VC/Tools/MSVC/*/include" -include stdatomic.h -recurse | del - name: Fix MSVC atomic headers
- name: vcpkg package restore run: dir "C:/Program Files/Microsoft Visual Studio/2022/*/VC/Tools/MSVC/*/include" -include stdatomic.h -recurse | del
if: false
run: vcpkg install freetype libpng openal-soft sdl2 rtmidi --triplet ${{ matrix.target.triplet }}
- name: Configure CMake - name: Configure CMake
run: > run: >
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" ${{ matrix.target.vcvars }} cmake -G Ninja -S . -B build
-D DEV_BUILD=${{ matrix.build.dev}} -D NEW_DYNAREC=${{ matrix.dynarec.new }} -D QT=${{ matrix.ui.qt }}
set PATH=C:/Program Files/LLVM/bin;%PATH% -D CMAKE_BUILD_TYPE=Debug
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=${{ matrix.build.type }}
-D NEW_DYNAREC=${{ matrix.build.new-dynarec }}
-D CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -D CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
-D VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${{ github.workspace }}/${{ matrix.target.toolchain }} -D VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${{ github.workspace }}/${{ matrix.target.toolchain }}
-D VCPKG_TARGET_TRIPLET=${{ matrix.target.triplet }} -D VCPKG_TARGET_TRIPLET=${{ matrix.target.triplet }}
-D QT=OFF -D VCPKG_HOST_TRIPLET=x64-windows
shell: cmd -D VCPKG_USE_HOST_TOOLS=ON
- name: Build - name: Fix Qt
if: matrix.ui.qt == 'on'
run: | run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" ${{ matrix.target.vcvars }} $qtTargetsPath = "${{ github.workspace }}/build/vcpkg_installed/${{ matrix.target.triplet }}/share/Qt6/Qt6Targets.cmake"
cmake --build build (Get-Content $qtTargetsPath) -replace "^.*-Zc:__cplusplus;-permissive-.*$","#$&" | Set-Content $qtTargetsPath
shell: cmd - name: Reconfigure CMake
if: matrix.ui.qt == 'on'
run: cmake clean build
- name: Build
run: cmake --build build
- name: Generate package - name: Generate package
run: cmake --install build --prefix ./build/artifacts ${{ matrix.build.strip }} run: cmake --install build --prefix ./build/artifacts
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: '86Box${{ matrix.build.slug }}-Windows-LLVM-${{ matrix.target.name }}-gha${{ github.run_number }}' name: '86Box${{ matrix.ui.slug }}${{ matrix.dynarec.slug }}${{ matrix.build.slug }}-Windows-LLVM-${{ matrix.target.name }}-gha${{ github.run_number }}'
path: build/artifacts/** path: build/artifacts/**
linux: linux: