Skip to content

Commit

Permalink
ci: windows: also produce a Qt5 build
Browse files Browse the repository at this point in the history
  • Loading branch information
adriweb committed Aug 7, 2024
1 parent 9de08bc commit e2761f1
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 132 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 @@ -17,6 +17,7 @@ jobs:
fail-fast: false
matrix:
arch: [x64]
qtver: [Qt5, Qt6]
config: [Release]
include:
- arch: x64
Expand Down Expand Up @@ -45,21 +46,21 @@ jobs:
uses: lukka/run-cmake@fbcfe006bc5450def7a319af91733647d985d157 # latest as of 2023-08-30
with:
cmakeListsTxtPath: '${{ github.workspace }}/gui/qt/CMakeLists.txt'
configurePreset: '${{ matrix.arch }}-${{ matrix.config }}'
buildPreset: '${{ matrix.arch }}-${{ matrix.config }}'
configurePreset: '${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}'
buildPreset: '${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}'
env:
VCPKG_FORCE_SYSTEM_BINARIES: 1

- name: Upload ${{ matrix.arch_name }} ${{ matrix.config }} EXE
uses: actions/upload-artifact@v3
with:
name: CEmu_win${{ matrix.arch_suffix }}_master
path: ${{ github.workspace }}/gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.config }}/CEmu.exe
path: ${{ github.workspace }}/gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}/CEmu.exe

- name: Prepare binary for release upload
if: ${{ matrix.config == 'Release' }}
run: |
Rename-Item -Path "${{ github.workspace }}/gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.config }}/CEmu.exe" -NewName "CEmu-nightly_win${{ matrix.arch_suffix }}-msvc_qt6.exe"
Rename-Item -Path "${{ github.workspace }}/gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}/CEmu.exe" -NewName "CEmu-nightly_win${{ matrix.arch_suffix }}-msvc_${{ matrix.qtver }}.exe"
- name: Update nightly release
if: ${{ matrix.config == 'Release' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
Expand All @@ -69,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_qt6.exe
./gui/qt/CEmu.build/${{ matrix.arch }}-${{ matrix.config }}/CEmu-nightly_win${{ matrix.arch_suffix }}-msvc_${{ matrix.qtver }}.exe
130 changes: 21 additions & 109 deletions gui/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ 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 @@ -70,21 +72,27 @@ endif()

include(GNUInstallDirs)

if(USE_QT5)
find_package(Qt5 REQUIRED COMPONENTS Core DBus Gui Network Widgets)
else()
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS DBus Gui Network Widgets)
endif()

set(CMAKE_AUTORCC ON)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS DBus Gui Network Widgets)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
if(COMMAND qt_standard_project_setup)
qt_standard_project_setup()
else()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
endif()

if(APPLE)
set(MAYBE_MACOSX_BUNDLE MACOSX_BUNDLE)
endif()

qt_add_executable(CEmu ${MAYBE_MACOSX_BUNDLE}
qt_add_resources(CEmu_Resources resources.qrc)

set(CEmu_Sources
../../core/asic.c ../../core/asic.h
../../core/atomics.h
../../core/backlight.c ../../core/backlight.h
Expand Down Expand Up @@ -186,8 +194,15 @@ qt_add_executable(CEmu ${MAYBE_MACOSX_BUNDLE}
tivars_lib_cpp/src/tivarslib_utils.cpp tivars_lib_cpp/src/tivarslib_utils.h
utils.cpp utils.h
visualizerwidget.cpp visualizerwidget.h
${CEmu_Resources}
)

if(USE_QT5)
add_executable(CEmu ${MAYBE_MACOSX_BUNDLE} ${CEmu_Sources})
else()
qt_add_executable(CEmu ${MAYBE_MACOSX_BUNDLE} ${CEmu_Sources})
endif()

# TODO better, see https://stackoverflow.com/a/21028226/378298
execute_process(
COMMAND git describe --abbrev=7 --always
Expand Down Expand Up @@ -349,109 +364,6 @@ target_link_libraries(CEmu PRIVATE
Qt::Widgets
)

qt_add_resources(CEmu "skins"
PREFIX "/skin"
FILES
"resources/skin/ti83pce.png"
"resources/skin/ti84pce.png"
"resources/skin/ti83pce_ep.png"
"resources/skin/ti84pce_py.png"
)
qt_add_resources(CEmu "setup"
PREFIX "/setup"
FILES
"resources/setup/home.png"
)
qt_add_resources(CEmu "icons"
PREFIX "/icons"
FILES
"resources/icons/add_mem.png"
"resources/icons/autotester.png"
"resources/icons/break_watch_port.png"
"resources/icons/breakpoints.png"
"resources/icons/bug.png"
"resources/icons/capture.png"
"resources/icons/change_cert.png"
"resources/icons/change_language.png"
"resources/icons/characters.png"
"resources/icons/check.png"
"resources/icons/check_update.png"
"resources/icons/checkgray.png"
"resources/icons/clock.png"
"resources/icons/console.png"
"resources/icons/cpu_status.png"
"resources/icons/debug_control.png"
"resources/icons/debugger.png"
"resources/icons/disasm.png"
"resources/icons/exit.png"
"resources/icons/export.png"
"resources/icons/generic_export.png"
"resources/icons/generic_import.png"
"resources/icons/goto.png"
"resources/icons/icon.ico"
"resources/icons/icon.png"
"resources/icons/import.png"
"resources/icons/info.png"
"resources/icons/key_history.png"
"resources/icons/keypad.png"
"resources/icons/lcd.png"
"resources/icons/memory.png"
"resources/icons/minus.png"
"resources/icons/misc.png"
"resources/icons/open.png"
"resources/icons/os_view.png"
"resources/icons/plus.png"
"resources/icons/port.png"
"resources/icons/profiler.png"
"resources/icons/ram_chip.png"
"resources/icons/record.png"
"resources/icons/refresh.png"
"resources/icons/reload_rom.png"
"resources/icons/reset.png"
"resources/icons/reset_cemu.png"
"resources/icons/reset_gui.png"
"resources/icons/rom_chip.png"
"resources/icons/run.png"
"resources/icons/save.png"
"resources/icons/screenshot.png"
"resources/icons/script.png"
"resources/icons/search.png"
"resources/icons/settings.png"
"resources/icons/source_code.png"
"resources/icons/stack.png"
"resources/icons/states.png"
"resources/icons/stepin.png"
"resources/icons/stepnext.png"
"resources/icons/stepout.png"
"resources/icons/stepover.png"
"resources/icons/stop.png"
"resources/icons/timers.png"
"resources/icons/toggle_console.png"
"resources/icons/ui_edit.png"
"resources/icons/variables.png"
"resources/icons/watchpoints.png"
"resources/icons/wizard.png"
)
qt_add_resources(CEmu "custom_fonts"
PREFIX "/fonts"
FILES
"resources/custom_fonts/LiberationSansNarrow-Bold.ttf"
"resources/custom_fonts/TICELarge.ttf"
)
qt_add_resources(CEmu "other"
PREFIX "/other"
FILES
"tivars_lib_cpp/programs_tokens.csv"
)
qt_add_resources(CEmu "i18n"
PREFIX "/i18n"
FILES
"i18n/es_ES.qm"
"i18n/fr_FR.qm"
"i18n/nl_NL.qm"
"i18n/zh_CN.qm"
)

if(CMAKE_BUILD_TYPE STREQUAL Release OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
include(CheckIPOSupported)
check_ipo_supported(RESULT supported OUTPUT error)
Expand Down
120 changes: 102 additions & 18 deletions gui/qt/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
}
},
{
"name": "x64-Debug",
"name": "x64-Debug-Qt6",
"inherits": "ninja-vcpkg-x64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
Expand All @@ -73,7 +73,17 @@
}
},
{
"name": "x64-RelWithDebInfo",
"name": "x64-Debug-Qt5",
"inherits": "x64-Debug-Qt6",
"cacheVariables": {
"USE_QT5": {
"type": "BOOL",
"value": "ON"
}
}
},
{
"name": "x64-RelWithDebInfo-Qt6",
"inherits": "ninja-vcpkg-x64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
Expand All @@ -83,7 +93,17 @@
}
},
{
"name": "x64-Release",
"name": "x64-RelWithDebInfo-Qt5",
"inherits": "x64-RelWithDebInfo-Qt6",
"cacheVariables": {
"USE_QT5": {
"type": "BOOL",
"value": "ON"
}
}
},
{
"name": "x64-Release-Qt6",
"inherits": "ninja-vcpkg-x64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
Expand All @@ -101,7 +121,17 @@
}
},
{
"name": "x86-Debug",
"name": "x64-Release-Qt5",
"inherits": "x64-Release-Qt6",
"cacheVariables": {
"USE_QT5": {
"type": "BOOL",
"value": "ON"
}
}
},
{
"name": "x86-Debug-Qt6",
"inherits": "ninja-vcpkg-x86",
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
Expand All @@ -111,7 +141,17 @@
}
},
{
"name": "x86-RelWithDebInfo",
"name": "x86-Debug-Qt5",
"inherits": "x86-Debug-Qt6",
"cacheVariables": {
"USE_QT5": {
"type": "BOOL",
"value": "ON"
}
}
},
{
"name": "x86-RelWithDebInfo-Qt6",
"inherits": "ninja-vcpkg-x86",
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
Expand All @@ -121,40 +161,84 @@
}
},
{
"name": "x86-Release",
"name": "x86-RelWithDebInfo-Qt5",
"inherits": "x86-RelWithDebInfo-Qt6",
"cacheVariables": {
"USE_QT5": {
"type": "BOOL",
"value": "ON"
}
}
},
{
"name": "x86-Release-Qt6",
"inherits": "ninja-vcpkg-x86",
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "Release"
}
}
},
{
"name": "x86-Release-Qt5",
"inherits": "x86-Release-Qt6",
"cacheVariables": {
"USE_QT5": {
"type": "BOOL",
"value": "ON"
}
}
}
],
"buildPresets": [
{
"name": "x64-Debug",
"configurePreset": "x64-Debug"
"name": "x64-Debug-Qt6",
"configurePreset": "x64-Debug-Qt6"
},
{
"name": "x64-Debug-Qt5",
"configurePreset": "x64-Debug-Qt5"
},
{
"name": "x64-RelWithDebInfo-Qt6",
"configurePreset": "x64-RelWithDebInfo-Qt6"
},
{
"name": "x64-RelWithDebInfo-Qt5",
"configurePreset": "x64-RelWithDebInfo-Qt5"
},
{
"name": "x64-Release-Qt6",
"configurePreset": "x64-Release-Qt6"
},
{
"name": "x64-Release-Qt5",
"configurePreset": "x64-Release-Qt5"
},
{
"name": "x86-Debug-Qt6",
"configurePreset": "x86-Debug-Qt6"
},
{
"name": "x64-RelWithDebInfo",
"configurePreset": "x64-RelWithDebInfo"
"name": "x86-Debug-Qt5",
"configurePreset": "x86-Debug-Qt5"
},
{
"name": "x64-Release",
"configurePreset": "x64-Release"
"name": "x86-RelWithDebInfo-Qt6",
"configurePreset": "x86-RelWithDebInfo-Qt6"
},
{
"name": "x86-Debug",
"configurePreset": "x86-Debug"
"name": "x86-RelWithDebInfo-Qt5",
"configurePreset": "x86-RelWithDebInfo-Qt5"
},
{
"name": "x86-RelWithDebInfo",
"configurePreset": "x86-RelWithDebInfo"
"name": "x86-Release-Qt6",
"configurePreset": "x86-Release-Qt6"
},
{
"name": "x86-Release",
"configurePreset": "x86-Release"
"name": "x86-Release-Qt5",
"configurePreset": "x86-Release-Qt5"
}
]
}
Loading

0 comments on commit e2761f1

Please sign in to comment.