Skip to content

Commit

Permalink
Use Ninja Multi-Config for cmake presets, add release-only option for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
calc84maniac committed Aug 9, 2024
1 parent 4173fa8 commit 8981085
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 130 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build.windows.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ jobs:
uses: lukka/run-cmake@4b1adc1944be8367be9f4e08303ce49918db8e3c # latest as of 2024-08-08
with:
cmakeListsTxtPath: '${{ github.workspace }}/gui/qt/CMakeLists.txt'
configurePreset: '${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}'
buildPreset: '${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}'
configurePreset: 'Win-${{ matrix.arch }}-${{ matrix.qtver }}'
configureAdditionalArgs: "['-DDEPS_RELEASE_ONLY=ON']"
buildPreset: 'Win-${{ matrix.arch }}-${{ matrix.qtver }}-${{ matrix.config }}'
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.arch }}-windows
VCPKG_DEFAULT_HOST_TRIPLET: x64-windows-static-release
Expand All @@ -63,13 +64,13 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: CEmu_win${{ matrix.arch_suffix }}_${{ matrix.qtver }}_master
path: ${{ github.workspace }}/gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}/CEmu.exe
path: ${{ github.workspace }}/gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.qtver }}/${{ matrix.config }}/CEmu.exe

- name: Prepare binary for release upload
if: ${{ matrix.config == 'Release' }}
run: |
$ReleaseName = "CEmu-nightly_win${{ matrix.arch_suffix }}-msvc_${{ matrix.qtver }}.exe".Replace("Qt", "qt")
Rename-Item -Path "${{ github.workspace }}/gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}/CEmu.exe" -NewName $ReleaseName
Rename-Item -Path "${{ github.workspace }}/gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.qtver }}/${{ matrix.config }}/CEmu.exe" -NewName $ReleaseName
echo "RELEASE_NAME=$ReleaseName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Update nightly release
Expand All @@ -80,4 +81,4 @@ jobs:
prerelease: true
token: ${{secrets.GITHUB_TOKEN}}
files: |
./gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}/${{ env.RELEASE_NAME }}
./gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.qtver }}/${{ matrix.config }}/${{ env.RELEASE_NAME }}
12 changes: 12 additions & 0 deletions gui/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ else()
list(APPEND VCPKG_MANIFEST_FEATURES "qt6")
endif()

option(DEPS_RELEASE_ONLY "Build only release versions of vcpkg dependencies" OFF)

if(DEPS_RELEASE_ONLY)
if(NOT DEFINED VCPKG_TARGET_TRIPLET)
message(FATAL_ERROR "Must provide a VCPKG_TARGET_TRIPLET to set as release only")
endif()
if(NOT VCPKG_TARGET_TRIPLET MATCHES "-release$")
set(VCPKG_TARGET_TRIPLET "${VCPKG_TARGET_TRIPLET}-release")
message("Updated VCPKG_TARGET_TRIPLET to ${VCPKG_TARGET_TRIPLET}")
endif()
endif()

project(CEmu
VERSION 2.0
LANGUAGES C CXX)
Expand Down
Loading

0 comments on commit 8981085

Please sign in to comment.