Skip to content

Commit

Permalink
Conditionally depend on Qt version in vcpkg manifest, fix some CI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
calc84maniac committed Aug 7, 2024
1 parent e2761f1 commit 2437493
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.windows.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
build:
name: "Build target: ${{ matrix.arch }}-${{ matrix.config }}"
name: "Build: Windows ${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}"
runs-on: windows-latest

strategy:
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Upload ${{ matrix.arch_name }} ${{ matrix.config }} EXE
uses: actions/upload-artifact@v3
with:
name: CEmu_win${{ matrix.arch_suffix }}_master
name: CEmu_win${{ matrix.arch_suffix }}_${{ matrix.qtver }}_master
path: ${{ github.workspace }}/gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}/CEmu.exe

- name: Prepare binary for release upload
Expand All @@ -70,4 +70,4 @@ jobs:
prerelease: true
token: ${{secrets.GITHUB_TOKEN}}
files: |
./gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.config }}/CEmu-nightly_win${{ matrix.arch_suffix }}-msvc_${{ matrix.qtver }}.exe
./gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}/CEmu-nightly_win${{ matrix.arch_suffix }}-msvc_${{ matrix.qtver }}.exe
12 changes: 10 additions & 2 deletions gui/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
cmake_minimum_required(VERSION 3.21.1)

option(USE_QT5 "Build with Qt5 instead of Qt6" OFF)

if(USE_QT5)
list(APPEND VCPKG_MANIFEST_FEATURES "qt5")
else()
list(APPEND VCPKG_MANIFEST_FEATURES "qt6")
endif()

project(CEmu
VERSION 2.0
LANGUAGES C CXX)
Expand All @@ -9,8 +17,6 @@ if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../core/debug/zdis/zdis.c" OR
message(FATAL_ERROR "Some files seem to be missing - you have to run 'git submodule init' and 'git submodule update' first.")
endif()

option(USE_QT5 "Build with Qt5 instead of Qt6" OFF)

option(TRY_STATIC_LIBS "Build using as many static libs as possible" OFF)
if (VCPKG_TARGET_TRIPLET MATCHES "-static(-md|-release)?$")
if(NOT TRY_STATIC_LIBS)
Expand Down Expand Up @@ -65,6 +71,8 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address,bounds -fsanitize-undefined-trap-on-error ")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address,bounds -fsanitize-undefined-trap-on-error ")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8")
if(MSVC_VERSION GREATER_EQUAL 1935)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /experimental:c11atomics")
endif()
Expand Down
30 changes: 21 additions & 9 deletions gui/qt/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,29 @@
{
"name": "libpng",
"features": [ "apng" ]
},
{
"name": "qtbase",
"default-features": false,
"features": [ "dbus", "gui", "network", "widgets", "png" ]
},
{
"name": "qt5-base",
"default-features": false
}
],
"features": {
"qt5": {
"description": "Build with Qt5",
"dependencies": [
{
"name": "qt5-base",
"default-features": false
}
]
},
"qt6": {
"description": "Build with Qt6",
"dependencies": [
{
"name": "qtbase",
"default-features": false,
"features": [ "dbus", "gui", "network", "widgets", "png" ]
}
]
}
},
"builtin-baseline": "ad25766aefb5313b6bc4e2a4b78a2946f84fbf66",
"overrides": [
{
Expand Down

0 comments on commit 2437493

Please sign in to comment.