Skip to content

Commit 35da107

Browse files
committed
[构建系统]: 移除QMake方案并全面强化CMake构建体系
**移除QMake**: 彻底删除所有`.pro`、`.pri`文件,包括主工程文件`Qt-Media.pro`、子项目文件及`common.pri`等共享配置 **增强CMake**: 重构CMake架构,新增`ArchitectureDetection.cmake`、`CompilerSettings.cmake`等模块化配置,提升构建灵活性 **依赖管理**: 升级vcpkg至manifest模式,简化依赖声明,移除平台特定的vcpkg安装命令,统一使用`vcpkg.json`管理 **Qt版本**: 将Qt基础版本从6.9.2升级至6.10.1,更新相关模块配置 **构建流程**: 移除QMake专用的GitHub Actions工作流(`qmake.yml`、`toolchain.yml`),优化CMake构建流程 **跨平台支持**: 改进macOS部署目标至13.0,增强Windows开发环境脚本(替换`setVsDev.ps1`为`Enter-VsDevShell.ps1`) **代码组织**: 清理冗余构建文件,优化`.gitignore`规则,移除不再需要的构建目录结构定义 **示例工程**: 统一示例项目的构建方式,全部转为CMake构建,移除对应的QMake项目文件
1 parent 877851d commit 35da107

File tree

108 files changed

+2680
-2036
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2680
-2036
lines changed
Lines changed: 22 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,33 @@
1-
name: 'Install Dependencies'
2-
description: 'Install vcpkg libraries and qt environment'
1+
name: "Install Dependencies"
2+
description: "Install vcpkg libraries and qt environment"
33
inputs:
4-
vcpkg_libs:
5-
description: 'vcpkg libraries'
6-
required: false
7-
default: 'breakpad crashpad'
8-
type: string
9-
vcpkg_ffmpeg_features:
10-
description: 'vcpkg ffmpeg features'
11-
required: false
12-
default: 'opengl,ass,bzip2,freetype,fribidi,zlib,gpl,ffmpeg,ffplay,ffprobe'
13-
type: string
144
qt_modules:
15-
description: 'qt modules'
5+
description: "qt modules"
166
required: false
17-
default: 'qt5compat qtnetworkauth qtmultimedia qtimageformats'
7+
default: "qt5compat qtnetworkauth qtmultimedia qtimageformats"
188
type: string
199
qt_ver:
20-
description: 'qt version'
10+
description: "qt version"
2111
required: false
22-
default: '6.9.2'
12+
default: "6.10.1"
2313
type: string
2414

2515
runs:
26-
using: 'composite'
16+
using: "composite"
2717

2818
steps:
2919
- name: Install Custom VCPKG
3020
uses: RealChuan/install-vcpkg@main
31-
32-
- name: Delete vcpkg.json
21+
22+
- name: Update vcpkg manifest baseline
3323
shell: bash
3424
run: |
35-
rm vcpkg.json
36-
37-
- name: Cache windows vcpkg
38-
if: runner.os == 'Windows'
39-
uses: actions/cache@v4
40-
with:
41-
path: C:\vcpkg\installed
42-
key: ${{ runner.os }}-vcpkg-installed-${{ github.sha }}
43-
restore-keys: |
44-
${{ runner.os }}-vcpkg-installed-
45-
${{ runner.os }}-
25+
vcpkg x-update-baseline
4626
47-
- name: Cache macos or linux vcpkg
48-
if: runner.os == 'macOS' || runner.os == 'Linux'
27+
- name: Cache vcpkg
4928
uses: actions/cache@v4
50-
with:
51-
path: /usr/local/share/vcpkg/installed
29+
with:
30+
path: ${{ github.workspace }}/build/vcpkg_installed
5231
key: ${{ runner.os }}-vcpkg-installed-${{ github.sha }}
5332
restore-keys: |
5433
${{ runner.os }}-vcpkg-installed-
@@ -61,41 +40,36 @@ runs:
6140
choco install ninja
6241
ninja --version
6342
cmake --version
64-
vcpkg install ${{ inputs.vcpkg_libs }} \
65-
ffmpeg[${{ inputs.vcpkg_ffmpeg_features }},amf,nvcodec,qsv] --triplet x64-windows \
66-
|| (cat C:/vcpkg/installed/vcpkg/issue_body.md && exit 1)
6743
6844
- name: Install dependencies on macos
6945
if: runner.os == 'macOS'
7046
shell: bash
7147
run: |
72-
brew install nasm python-setuptools mpv
48+
brew install nasm python-setuptools mpv \
49+
autoconf autoconf-archive automake libtool
7350
ninja --version
7451
cmake --version
7552
clang --version
76-
vcpkg install ${{ inputs.vcpkg_libs }} \
77-
ffmpeg[${{ inputs.vcpkg_ffmpeg_features }}] --triplet arm64-osx \
78-
|| (cat /usr/local/share/vcpkg/installed/vcpkg/issue_body.md && exit 1)
7953
8054
- name: Install dependencies on linux
8155
if: runner.os == 'Linux'
8256
shell: bash
8357
run: |
8458
sudo apt-get update
8559
sudo apt-get install ninja-build nasm autopoint gperf libgl1-mesa-dev \
86-
libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev libltdl-dev \
87-
mpv libmpv-dev
60+
libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev libltdl-dev \
61+
libcryptsetup-dev libkeyutils-dev libcap-dev systemtap-sdt-dev \
62+
autoconf autoconf-archive automake libtool \
63+
mpv libmpv-dev \
64+
python3-jinja2
65+
8866
ninja --version
8967
cmake --version
9068
gcc --version
91-
vcpkg install ${{ inputs.vcpkg_libs }} \
92-
ffmpeg[${{ inputs.vcpkg_ffmpeg_features }},amf,nvcodec] --triplet x64-linux \
93-
|| (cat /usr/local/share/vcpkg/installed/vcpkg/issue_body.md && exit 1)
9469
9570
- name: Install Qt
9671
uses: jurplel/install-qt-action@v4
9772
with:
9873
version: ${{ inputs.qt_ver }}
9974
modules: ${{ inputs.qt_modules }}
100-
cache: 'true'
101-
75+
cache: "true"

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
version: 2
77
updates:
88
- package-ecosystem: "github-actions" # See documentation for possible values
9-
directories :
9+
directories:
1010
- "/" # Location of package manifests
1111
- "/.github/actions/**"
1212
schedule:

.github/workflows/clean_cache.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Cleanup caches by a branch
22
on:
33
# 每周一 0 点触发
44
schedule:
5-
- cron: '0 0 * * 1'
5+
- cron: "0 0 * * 1"
66
workflow_dispatch:
77

88
jobs:
@@ -15,12 +15,12 @@ jobs:
1515
contents: read
1616
steps:
1717
- name: Check out code
18-
uses: actions/checkout@v5
18+
uses: actions/checkout@v6
1919

2020
- name: Cleanup
2121
run: |
2222
gh extension install actions/gh-actions-cache
23-
23+
2424
REPO=${{ github.repository }}
2525
BRANCH=${{ github.ref }}
2626
@@ -37,4 +37,3 @@ jobs:
3737
echo "Done"
3838
env:
3939
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40-

.github/workflows/cmake.yml

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
name: CMake build
22

3-
on:
3+
on:
44
push:
55
paths-ignore:
6-
- 'doc/**'
7-
- 'packaging/**'
8-
- '.clang*'
9-
- '.gitignore'
10-
- 'LICENSE'
11-
- 'README*'
6+
- "docs/**"
7+
- "**/*.md"
8+
- "**/.clang-*"
9+
- "**/.gitignore"
10+
- "**/LICENSE*"
11+
- "**/README*"
1212
pull_request:
1313
paths-ignore:
14-
- 'doc/**'
15-
- 'packaging/**'
16-
- '.clang*'
17-
- '.gitignore'
18-
- 'LICENSE'
19-
- 'README*'
14+
- "docs/**"
15+
- "**/*.md"
16+
- "**/.clang-*"
17+
- "**/.gitignore"
18+
- "**/LICENSE*"
19+
- "**/README*"
2020

2121
env:
22-
MACOSX_DEPLOYMENT_TARGET: 11.0
22+
MACOSX_DEPLOYMENT_TARGET: 13.0
23+
BUILD_DIR: build
24+
BUILD_TYPE: RelWithDebInfo
2325

2426
jobs:
2527
build:
@@ -32,38 +34,35 @@ jobs:
3234
- windows-latest
3335
- macos-latest
3436
- ubuntu-latest
35-
build_type:
36-
- "RelWithDebInfo"
3737
generators:
3838
- "Ninja"
3939

4040
steps:
41-
- uses: actions/checkout@v5
42-
with:
41+
- uses: actions/checkout@v6
42+
with:
4343
fetch-depth: 1
44-
44+
4545
- uses: ./.github/actions/install-dependencies
4646

4747
- name: Configure and build windows
48-
if: startsWith(matrix.os, 'windows')
48+
if: runner.os == 'Windows'
4949
shell: pwsh
5050
run: |
51-
.\scripts\windows\setVsDev.ps1
51+
.\packaging\windows\Enter-VsDevShell.ps1
5252
cmake `
5353
-S . `
54-
-B ./build `
55-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
54+
-B "${{ env.BUILD_DIR }}" `
55+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
5656
-DBUILD_MPV=OFF `
5757
-G "${{ matrix.generators }}"
58-
cmake --build ./build --config ${{ matrix.build_type }}
58+
cmake --build ./build --config ${{ env.BUILD_TYPE }}
5959
- name: Configure and build on ubuntu or macos
60-
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
60+
if: runner.os == 'macOS' || runner.os == 'Linux'
6161
shell: bash
6262
run: |
6363
cmake \
6464
-S . \
65-
-B ./build \
66-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
65+
-B "${{ env.BUILD_DIR }}" \
66+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
6767
-G "${{ matrix.generators }}"
68-
cmake --build ./build --config ${{ matrix.build_type }}
69-
68+
cmake --build ./build --config ${{ env.BUILD_TYPE }}

.github/workflows/codeql.yml

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,52 @@
11
name: CodeQL
22

3-
on:
3+
on:
44
push:
55
paths-ignore:
6-
- 'doc/**'
7-
- 'packaging/**'
8-
- '.clang*'
9-
- '.gitignore'
10-
- 'LICENSE'
11-
- 'README*'
6+
- "docs/**"
7+
- "**/*.md"
8+
- "**/.clang-*"
9+
- "**/.gitignore"
10+
- "**/LICENSE*"
11+
- "**/README*"
1212
branches-ignore:
13-
- 'dependabot/**'
13+
- "dependabot/**"
1414
pull_request:
1515
paths-ignore:
16-
- 'doc/**'
17-
- 'packaging/**'
18-
- '.clang*'
19-
- '.gitignore'
20-
- 'LICENSE'
21-
- 'README*'
16+
- "docs/**"
17+
- "**/*.md"
18+
- "**/.clang-*"
19+
- "**/.gitignore"
20+
- "**/LICENSE*"
21+
- "**/README*"
2222
branches-ignore:
23-
- 'dependabot/**'
24-
23+
- "dependabot/**"
24+
2525
schedule:
26-
- cron: '0 0 1 * *'
26+
- cron: "0 0 1 * *"
2727
workflow_dispatch:
28-
28+
2929
env:
30-
MACOSX_DEPLOYMENT_TARGET: 11.0
30+
MACOSX_DEPLOYMENT_TARGET: 13.0
3131

3232
jobs:
3333
CodeQL:
3434
runs-on: ubuntu-latest
35-
36-
steps:
37-
- uses: actions/checkout@v5
35+
36+
steps:
37+
- uses: actions/checkout@v6
3838
with:
3939
fetch-depth: 1
4040

4141
- uses: ./.github/actions/install-dependencies
4242

4343
- name: Initialize CodeQL
44-
uses: github/codeql-action/init@v3
44+
uses: github/codeql-action/init@v4
4545
with:
46-
languages: cpp
46+
languages: cpp
4747

4848
- name: Autobuild
49-
uses: github/codeql-action/autobuild@v3
49+
uses: github/codeql-action/autobuild@v4
5050

5151
- name: Perform CodeQL Analysis
52-
uses: github/codeql-action/analyze@v3
53-
52+
uses: github/codeql-action/analyze@v4

0 commit comments

Comments
 (0)