Skip to content

Commit d55387d

Browse files
Added windows-cmake.yml file
1 parent ec19671 commit d55387d

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

.github/workflows/windows-cmake.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: windows-builds
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build_windows_msvc:
9+
name: Build with MSVC and Ninja
10+
runs-on: windows-2022
11+
12+
env:
13+
QT_VERSION: 6.4.2
14+
QT_DIR: ${{ github.workspace }}\Qt
15+
16+
steps:
17+
- name: 📦 Checkout source code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: ⚙️ Install Ninja build system
23+
run: choco install ninja --no-progress
24+
25+
- name: 📥 Install Qt for MSVC
26+
uses: jurplel/install-qt-action@v3
27+
with:
28+
version: ${{ env.QT_VERSION }}
29+
target: desktop
30+
host: windows
31+
arch: win64_msvc2019_64
32+
dir: ${{ env.QT_DIR }}
33+
setup-python: false
34+
35+
- name: 🏗️ Setup MSVC Developer Environment
36+
uses: TheMrMilchmann/setup-msvc-dev@v3
37+
with:
38+
arch: x64
39+
40+
- name: 🛠️ Configure CMake with Ninja + MSVC
41+
run: |
42+
cmake -S . -B build -G Ninja `
43+
-DCMAKE_PREFIX_PATH="${{ env.QT_DIR }}\Qt\${{ env.QT_VERSION }}\msvc2019_64" `
44+
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}\install" `
45+
-DCMAKE_BUILD_TYPE=Release
46+
shell: powershell
47+
48+
- name: 🔨 Build with Ninja + MSVC
49+
run: cmake --build build
50+
shell: powershell
51+
52+
- name: 📦 Install built files
53+
run: cmake --install build
54+
shell: powershell
55+
56+
build_windows_mingw:
57+
name: Build with Qt's MinGW and CMake (no Ninja)
58+
runs-on: windows-2022
59+
60+
env:
61+
QT_VERSION: 6.8.3
62+
QT_DIR: ${{ github.workspace }}\Qt
63+
64+
steps:
65+
- name: 📦 Checkout source code
66+
uses: actions/checkout@v4
67+
with:
68+
fetch-depth: 0
69+
70+
- name: 📥 Install Qt + MinGW
71+
uses: jurplel/install-qt-action@v4
72+
with:
73+
aqtversion: '==3.1.19'
74+
version: ${{ env.QT_VERSION }}
75+
target: desktop
76+
host: windows
77+
arch: win64_mingw
78+
dir: ${{ env.QT_DIR }}
79+
tools: 'tools_mingw1310'
80+
setup-python: false
81+
82+
- name: ➕ Add Qt-bundled MinGW to PATH
83+
shell: powershell
84+
run: |
85+
echo "${{ env.QT_DIR }}\Tools\mingw1310_64\bin" >> $env:GITHUB_PATH
86+
87+
- name: 🛠️ Configure CMake (MinGW)
88+
shell: powershell
89+
run: |
90+
cmake -S . -B build-mingw `
91+
-DCMAKE_PREFIX_PATH="${{ env.QT_DIR }}\Qt\${{ env.QT_VERSION }}\mingw_64" `
92+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install `
93+
-DCMAKE_BUILD_TYPE=Release `
94+
-G "MinGW Makefiles"
95+
96+
- name: 🔨 Build with CMake (MinGW)
97+
shell: powershell
98+
run: cmake --build build-mingw -- -j2
99+
100+
- name: 📦 Install built files (MinGW)
101+
shell: powershell
102+
run: cmake --install build-mingw

0 commit comments

Comments
 (0)