Skip to content

Commit

Permalink
[更新]:提升 Qt 版本至 6.8.0 并优化 GitHub Actions 配置
Browse files Browse the repository at this point in the history
- 将 Qt 版本从 6.7.2 更新至 6.8.0,以利用最新的功能和改进。
- 优化了 GitHub Actions 工作流中的条件判断,使用 `runner.os == 'Windows'` 替代 `startsWith(runner.os, 'Windows')`,提高代码的可读性和效率。
- 在 `.github/dependabot.yml` 文件中新增了 Dependabot 配置,启用了对 GitHub Actions 的版本更新监控。
- 更新了 `MACOSX_DEPLOYMENT_TARGET` 环境变量从 11.0 升级到 12.0,以适配最新的 macOS 系统。
- 在 Windows 工作流中,更新了 `setVsDev.ps1` 脚本的使用,移除了版本范围限制,以使用最新的 Visual Studio 版本。
- 更新了 Qt 相关的库链接方式,从 `Qt6::` 前缀更新为 `Qt::`,以匹配 Qt 6.8.0 的库命名规范。
  • Loading branch information
RealChuan committed Nov 4, 2024
1 parent d46abc9 commit 6c5f381
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 45 deletions.
24 changes: 17 additions & 7 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ inputs:
qt_ver:
description: 'qt version'
required: false
default: '6.7.2'
default: '6.8.0'
type: string

runs:
Expand All @@ -37,7 +37,7 @@ runs:
rm vcpkg.json
- name: Cache windows vcpkg
if: startsWith(runner.os, 'Windows')
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
path: C:\vcpkg\installed
Expand All @@ -49,7 +49,7 @@ runs:
save-always: true

- name: Cache macos or linux vcpkg
if: startsWith(runner.os, 'macOS') || startsWith(runner.os, 'Linux')
if: runner.os == 'macOS' || runner.os == 'Linux'
uses: actions/cache@v4
with:
path: /usr/local/share/vcpkg/installed
Expand All @@ -61,7 +61,7 @@ runs:
save-always: true

- name: Install dependencies on windows
if: startsWith(runner.os, 'Windows')
if: runner.os == 'Windows'
shell: bash
run: |
choco install ninja
Expand All @@ -70,7 +70,7 @@ runs:
vcpkg install ${{ inputs.vcpkg_libs }} --triplet x64-windows || (cat C:/vcpkg/installed/vcpkg/issue_body.md && exit 1)
- name: Install dependencies on macos
if: startsWith(runner.os, 'macOS')
if: runner.os == 'macOS'
shell: bash
run: |
brew install ninja python-setuptools
Expand All @@ -81,7 +81,7 @@ runs:
vcpkg install ${{ inputs.vcpkg_libs }} --triplet arm64-osx || (cat /usr/local/share/vcpkg/installed/vcpkg/issue_body.md && exit 1)
- name: Install dependencies on linux
if: startsWith(runner.os, 'Linux')
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
Expand All @@ -91,13 +91,23 @@ runs:
gcc --version
vcpkg install ${{ inputs.vcpkg_libs }} --triplet x64-linux || (cat /usr/local/share/vcpkg/installed/vcpkg/issue_body.md && exit 1)
- name: Install Qt
- name: Install Qt on non-windows
if: runner.os == 'macOS' || runner.os == 'Linux'
uses: jurplel/install-qt-action@v4
with:
version: ${{ inputs.qt_ver }}
modules: ${{ inputs.qt_modules }}
cache: 'true'

- name: Install Qt on windows
if: runner.os == 'Windows'
uses: jurplel/install-qt-action@v4
with:
version: ${{ inputs.qt_ver }}
modules: ${{ inputs.qt_modules }}
cache: 'true'
arch: 'win64_msvc2022_64'

- name: Install Vulkan SDK
uses: humbletim/install-vulkan-sdk@main
with:
Expand Down
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- 'README*'

env:
MACOSX_DEPLOYMENT_TARGET: 11.0
MACOSX_DEPLOYMENT_TARGET: 12.0

jobs:
build:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/qmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- 'README*'

env:
MACOSX_DEPLOYMENT_TARGET: 11.0
MACOSX_DEPLOYMENT_TARGET: 12.0

jobs:
build:
Expand All @@ -27,7 +27,7 @@ jobs:
fail-fast: false
matrix:
os:
- windows-2019
- windows-latest
- macos-latest
- ubuntu-latest

Expand All @@ -51,7 +51,7 @@ jobs:
if: startsWith(matrix.os, 'windows')
shell: pwsh
run: |
..\scripts\windows\setVsDev.ps1 -VersionRange "[16.0,17.0)" -Arch "x64"
..\scripts\windows\setVsDev.ps1
& qmake ./../.
& jom
working-directory: build
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch:

env:
MACOSX_DEPLOYMENT_TARGET: 11.0
MACOSX_DEPLOYMENT_TARGET: 12.0

jobs:
build:
Expand All @@ -20,7 +20,6 @@ jobs:
matrix:
os:
- windows-latest
- windows-2019
- macos-latest
- ubuntu-latest

Expand Down
4 changes: 2 additions & 2 deletions cmake/qt.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if(CMAKE_HOST_WIN32)
list(APPEND CMAKE_PREFIX_PATH "C:\\Qt\\6.7.2\\msvc2019_64")
list(APPEND CMAKE_PREFIX_PATH "C:\\Qt\\6.8.0\\msvc2022_64")
elseif(CMAKE_HOST_APPLE)

elseif(CMAKE_HOST_LINUX)
list(APPEND CMAKE_PREFIX_PATH "/opt/Qt/6.7.2/gcc_64")
list(APPEND CMAKE_PREFIX_PATH "/opt/Qt/6.8.0/gcc_64")
endif()
10 changes: 5 additions & 5 deletions examples/graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ target_link_libraries(
thirdparty
dump
utils
Qt6::Gui
Qt6::Widgets
Qt6::OpenGLWidgets
Qt6::Network
Qt6::Concurrent
Qt::Gui
Qt::Widgets
Qt::OpenGLWidgets
Qt::Network
Qt::Concurrent
egif)
qt_finalize_executable(Qt-Graphics)
10 changes: 5 additions & 5 deletions examples/rhiviewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ target_link_libraries(
thirdparty
dump
utils
Qt6::GuiPrivate
Qt6::Gui
Qt6::Widgets
Qt6::Network
Qt6::Concurrent)
Qt::GuiPrivate
Qt::Gui
Qt::Widgets
Qt::Network
Qt::Concurrent)
qt_finalize_executable(Qt-RhiViewer)
2 changes: 1 addition & 1 deletion src/3rdparty/3rdparty.pri
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ CONFIG(debug, debug|release) {
-llibbreakpad_client -llibbreakpad
}

LIBS += -lcommon -lclient -lutil -lbase
LIBS += -lvcpkg_crashpad_client_common -lvcpkg_crashpad_client -lvcpkg_crashpad_util -lvcpkg_crashpad_base

LIBS += -lgif

Expand Down
4 changes: 2 additions & 2 deletions src/3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ set(PROJECT_SOURCES
thirdparty_global.hpp)

add_custom_library(thirdparty ${PROJECT_SOURCES})
target_link_libraries(thirdparty PRIVATE shared_qtlockedfile utils Qt6::Network
Qt6::Widgets)
target_link_libraries(thirdparty PRIVATE shared_qtlockedfile utils Qt::Network
Qt::Widgets)

if(CMAKE_HOST_WIN32)
target_compile_definitions(thirdparty PRIVATE "THRIDPARTY_LIBRARY")
Expand Down
2 changes: 1 addition & 1 deletion src/3rdparty/gif/egif/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(PROJECT_SOURCES GifEncoder.cpp GifEncoder.h NeuQuant.cpp NeuQuant.h)

add_custom_library(egif ${PROJECT_SOURCES})
target_link_libraries(egif PRIVATE GIF::GIF Qt6::Widgets)
target_link_libraries(egif PRIVATE GIF::GIF Qt::Widgets)

if(CMAKE_HOST_WIN32)
target_compile_definitions(egif PRIVATE "THRIDPARTY_LIBRARY" _UNICODE UNICODE)
Expand Down
2 changes: 1 addition & 1 deletion src/3rdparty/qtlockedfile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ endif()

add_library(shared_qtlockedfile STATIC ${OS_SOURCES} qtlockedfile.cpp
qtlockedfile.h)
target_link_libraries(shared_qtlockedfile Qt6::Core)
target_link_libraries(shared_qtlockedfile Qt::Core)
target_include_directories(shared_qtlockedfile
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
if(CMAKE_HOST_WIN32)
Expand Down
18 changes: 10 additions & 8 deletions src/3rdparty/qtsingleapplication/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
add_library(shared_qtsingleapplication SHARED
qtsingleapplication.cpp qtsingleapplication.h
qtlocalpeer.cpp qtlocalpeer.h
)
target_link_libraries(shared_qtsingleapplication shared_qtlockedfile Qt6::Core Qt6::Network Qt6::Widgets)
target_include_directories(shared_qtsingleapplication PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
if (WIN32)
target_compile_definitions(shared_qtsingleapplication PRIVATE "THRIDPARTY_LIBRARY" _UNICODE UNICODE)
add_library(
shared_qtsingleapplication SHARED
qtsingleapplication.cpp qtsingleapplication.h qtlocalpeer.cpp qtlocalpeer.h)
target_link_libraries(shared_qtsingleapplication shared_qtlockedfile Qt::Core
Qt::Network Qt::Widgets)
target_include_directories(shared_qtsingleapplication
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
if(WIN32)
target_compile_definitions(shared_qtsingleapplication
PRIVATE "THRIDPARTY_LIBRARY" _UNICODE UNICODE)
endif()
2 changes: 1 addition & 1 deletion src/dump/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set(PROJECT_SOURCES breakpad.hpp breakpad.cc crashpad.hpp crashpad.cc
dump_global.hpp)
add_custom_library(dump ${PROJECT_SOURCES})
target_link_libraries(
dump PRIVATE utils Qt6::Widgets unofficial::breakpad::libbreakpad
dump PRIVATE utils Qt::Widgets unofficial::breakpad::libbreakpad
unofficial::breakpad::libbreakpad_client crashpad::crashpad)

if(CMAKE_HOST_WIN32)
Expand Down
4 changes: 2 additions & 2 deletions src/gpugraphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ endif()
qt_add_resources(SOURCES shader.qrc)

add_custom_library(gpugraphics ${PROJECT_SOURCES} ${SOURCES})
target_link_libraries(gpugraphics PRIVATE Qt6::GuiPrivate Qt6::Gui Qt6::Widgets
Qt6::OpenGLWidgets)
target_link_libraries(gpugraphics PRIVATE Qt::GuiPrivate Qt::Gui Qt::Widgets
Qt::OpenGLWidgets)

if(CMAKE_HOST_WIN32)
target_compile_definitions(gpugraphics PRIVATE "GPUGRAPHICS_LIBRARY")
Expand Down
2 changes: 1 addition & 1 deletion src/gpugraphics/shader/complie_qsb.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Set-Location $PSScriptRoot

$qsb = "C:\Qt\6.7.2\msvc2019_64\bin\qsb.exe"
$qsb = "C:\Qt\6.8.0\msvc2022_64\bin\qsb.exe"

& $qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o vulkan.vert.qsb vulkan.vert
& $qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o vulkan.frag.qsb vulkan.frag
2 changes: 1 addition & 1 deletion src/graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set(PROJECT_SOURCES
imageview.h)

add_custom_library(graphics ${PROJECT_SOURCES})
target_link_libraries(graphics PRIVATE Qt6::Widgets)
target_link_libraries(graphics PRIVATE Qt::Widgets)

if(CMAKE_HOST_WIN32)
target_compile_definitions(graphics PRIVATE "GRAPHICS_LIBRARY")
Expand Down
2 changes: 1 addition & 1 deletion src/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set(PROJECT_SOURCES
validator.hpp)

add_custom_library(utils ${PROJECT_SOURCES})
target_link_libraries(utils PRIVATE Qt6::Widgets Qt6::Core5Compat)
target_link_libraries(utils PRIVATE Qt::Widgets Qt::Core5Compat)

if(CMAKE_HOST_WIN32)
target_compile_definitions(utils PRIVATE "UTILS_LIBRARY")
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"crashpad",
"giflib"
],
"builtin-baseline": "fe1cde61e971d53c9687cf9a46308f8f55da19fa"
"builtin-baseline": "5f4628b89f3f98cd9a0b43c27ded2aa53da1f790"
}

0 comments on commit 6c5f381

Please sign in to comment.