try dynamic #22
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 Build (Windows VCPKG) | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
name: ${{ matrix.target }} | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x64-windows, arm64-windows] | |
env: | |
VCPKG_DEFAULT_TRIPLET: ${{ matrix.target }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
repository: "microsoft/vcpkg" | |
path: "vcpkg" | |
- name: Retrieve version and apply libslirp patch | |
shell: "bash" | |
run: | | |
cd vcpkg | |
echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
echo 'diff --git a/ports/libslirp/portfile.cmake b/ports/libslirp/portfile.cmake' | tee -a libslirp-update.patch | |
echo 'index 0bd6e252c..756e4b9b8 100644' | tee -a libslirp-update.patch | |
echo '--- a/ports/libslirp/portfile.cmake' | tee -a libslirp-update.patch | |
echo '+++ b/ports/libslirp/portfile.cmake' | tee -a libslirp-update.patch | |
echo '@@ -2,8 +2,8 @@ vcpkg_from_gitlab(' | tee -a libslirp-update.patch | |
echo ' GITLAB_URL https://gitlab.freedesktop.org/' | tee -a libslirp-update.patch | |
echo ' OUT_SOURCE_PATH SOURCE_PATH' | tee -a libslirp-update.patch | |
echo ' REPO slirp/libslirp' | tee -a libslirp-update.patch | |
echo '- REF v4.7.0' | tee -a libslirp-update.patch | |
echo '- SHA512 387f4a6dad240ce633df2640bb49c6cb0041c8b3afc8d0ef38186d385f00dd9e4ef4443e93e1b71dbf05e22892b6f2771a87a202e815d8ec899ab5c147a1f09f' | tee -a libslirp-update.patch | |
echo '+ REF 129077f9870426d1b7b3a8239d8b5a50bee017b4' | tee -a libslirp-update.patch | |
echo '+ SHA512 8223352cf09154a857960b852c9b1a8a01ab0c86c3cc873fc37da337174c59b68b50939cffc018c91f320000da09ce833acf966a3492de1453bc7196d14c1198' | tee -a libslirp-update.patch | |
echo ' HEAD_REF master' | tee -a libslirp-update.patch | |
echo ' )' | tee -a libslirp-update.patch | |
echo '' | tee -a libslirp-update.patch | |
echo 'diff --git a/ports/libslirp/vcpkg.json b/ports/libslirp/vcpkg.json' | tee -a libslirp-update.patch | |
echo 'index 032e5cc5d..f849f54c3 100644' | tee -a libslirp-update.patch | |
echo '--- a/ports/libslirp/vcpkg.json' | tee -a libslirp-update.patch | |
echo '+++ b/ports/libslirp/vcpkg.json' | tee -a libslirp-update.patch | |
echo '@@ -4,7 +4,7 @@' | tee -a libslirp-update.patch | |
echo ' "description": "libslirp is a user-mode networking library used by virtual machines, containers or various tools.",' | tee -a libslirp-update.patch | |
echo ' "homepage": "https://gitlab.freedesktop.org/slirp/libslirp",' | tee -a libslirp-update.patch | |
echo ' "license": "BSD-3-Clause",' | tee -a libslirp-update.patch | |
echo '- "supports": "!windows | mingw",' | tee -a libslirp-update.patch | |
echo '+ "supports": "windows | mingw",' | tee -a libslirp-update.patch | |
echo ' "dependencies": [' | tee -a libslirp-update.patch | |
echo ' "glib",' | tee -a libslirp-update.patch | |
echo ' {' | tee -a libslirp-update.patch | |
git apply ./libslirp-update.patch --reject --whitespace=fix | |
id: version | |
- uses: lukka/get-cmake@latest | |
- name: Restore artifacts, or setup vcpkg for building artifacts | |
uses: lukka/run-vcpkg@v11 | |
id: runvcpkg | |
with: | |
vcpkgDirectory: '${{ github.workspace }}/vcpkg' | |
vcpkgJsonGlob: '**/vcpkg.json' | |
vcpkgGitCommitId: '${{ steps.version.outputs.GIT_COMMIT }}' | |
runVcpkgInstall: true | |
- name: List $RUNNER_WORKSPACE before build | |
run: find $RUNNER_WORKSPACE | |
shell: bash | |
- name: Prints output of run-vcpkg's action. | |
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' " | |
- name: Configure | |
#uses: lukka/run-cmake@v10 | |
working-directory: ${{github.workspace}} | |
run: cmake -B build $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_STATIC=ON -DUSE_QT6=ON -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
- name: Make | |
working-directory: ${{github.workspace}}/build | |
run: cmake --build . | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: melonDS-${{matrix.target}} | |
path: ${{github.workspace}}\build\melonDS.exe |