Skip to content

Commit 797acd9

Browse files
committed
Port changes from Qt v6.4.1
1 parent ea2373c commit 797acd9

5 files changed

Lines changed: 63 additions & 22 deletions

File tree

.github/workflows/ccpp.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,47 @@ name: Build
44
on: push
55

66
jobs:
7-
87
linux:
9-
runs-on: ubuntu-20.04
10-
container: docker://jgeudens/qt-linux:5.15.2_build_1
8+
runs-on: ubuntu-latest
9+
10+
container:
11+
image: docker://jgeudens/qt-linux:6.4.1_build_1
1112
steps:
12-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1314

1415
- name: Update Modules and Build
15-
run: sh scripts/build_linux.sh
16+
run: bash scripts/build_linux.sh
1617

1718
- name: Deploy
18-
run: sh scripts/deploy_linux.sh
19+
run: bash scripts/deploy_linux.sh
1920

20-
- uses: actions/upload-artifact@v2
21+
- uses: actions/upload-artifact@v3
2122
with:
2223
name: modbussim-linux
23-
path: release/bin/linux/ModbusSim*.AppImage
24+
path: ModbusSim*.AppImage
2425

2526
windows:
2627
runs-on: windows-2019
2728

2829
steps:
29-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v3
3031

3132
- name: Install Qt installer
3233
run: pip3 install aqtinstall
3334

35+
# Cache go build cache, used to speedup go test
36+
- name: Qt Build Cache
37+
uses: actions/cache@v3
38+
id: cache
39+
with:
40+
path: ${{ github.workspace }}\Qt
41+
key: ${{ runner.os }}-qt-build-${{ hashFiles('scripts\setup_windows.bat') }}
42+
3443
- name: Setup, build and deploy
3544
shell: cmd
36-
run: scripts/full_build_and_deploy_windows.bat ${{ github.workspace }}
45+
run: scripts\full_build_and_deploy_windows.bat '${{ steps.cache.outputs.cache-hit }}' ${{ github.workspace }}\Qt
3746

38-
- uses: actions/upload-artifact@v2
47+
- uses: actions/upload-artifact@v3
3948
with:
4049
name: modbussim-windows
4150
path: |

scripts/build_windows.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ echo %PATH%
99
g++ -v
1010

1111
cmake -G "Ninja" ..
12+
IF ERRORLEVEL 1 GOTO errorHandling
13+
1214
ninja
15+
IF ERRORLEVEL 1 GOTO errorHandling
1316

1417
cd ..
18+
19+
EXIT /B 0
20+
21+
:errorHandling
22+
EXIT /B 1

scripts/deploy_linux.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ chmod +x linuxdeploy*.AppImage
1818
export APPIMAGE_EXTRACT_AND_RUN=1 # Workaround because FUSE isn't available in Docker
1919
./linuxdeploy-x86_64.AppImage --appdir AppDir -e modbussim -i ModbusSim.png -d ModbusSim.desktop --plugin qt --output appimage
2020

21-
ls
21+
ls
22+
23+
cp ModbusSim*.AppImage ../../..
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
echo on
22

3-
call scripts\setup_windows.bat %1
3+
REM Usage (path is optional):
4+
REM Use cache: scripts\full_build_and_deploy_windows.bat 'true' [path]
5+
REM No cache: scripts\full_build_and_deploy_windows.bat '' [path]
6+
7+
call scripts\setup_windows.bat %1 %2
48
call scripts\build_windows.bat
5-
call scripts\deploy_windows.bat
9+
call scripts\deploy_windows.bat

scripts/setup_windows.bat

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,53 @@
11
echo on
22

3-
if "%~1"=="" (set "QT_INSTALL_DIR=D:\aqt_Qt\Qt") else (set "QT_INSTALL_DIR=%~1\Qt")
3+
echo Argument1: %~1
4+
echo Argument2: %~2
5+
6+
if "%~1"=="'true'" (set "CACHE_HIT=1") else (set "CACHE_HIT=0")
7+
if "%~2"=="" (set "QT_INSTALL_DIR=D:\aqt_Qt\Qt") else (set "QT_INSTALL_DIR=%~2")
48
echo QT_INSTALL_DIR: %QT_INSTALL_DIR%
9+
echo CACHE_HIT: %CACHE_HIT%
510

611
REM Set configuration
7-
set QT=5.15.2
8-
set QT_MODULES=
12+
set QT=6.4.1
13+
set QT_MODULES=qtserialbus qtserialport
914
set QT_HOST=windows
1015
set QT_TARGET=desktop
11-
set QT_ARCH=win64_mingw81
16+
set QT_ARCH=win64_mingw
17+
18+
set QT_ARCH_PATH=mingw_64
19+
20+
if %CACHE_HIT% EQU 1 (
21+
echo "Cache hit!"
22+
goto cache_hit
23+
)
1224

13-
set QT_ARCH_PATH=mingw81_64
25+
echo "Cache miss: installing Qt"
1426

1527
REM Install Qt
1628
aqt install-qt --outputdir %QT_INSTALL_DIR% %QT_HOST% %QT_TARGET% %QT% %QT_ARCH% -m %QT_MODULES%
1729

1830
REM Install Tools
19-
aqt install-tool --outputdir %QT_INSTALL_DIR% %QT_HOST% %QT_TARGET% tools_mingw qt.tools.win64_mingw810
31+
aqt install-tool --outputdir %QT_INSTALL_DIR% %QT_HOST% %QT_TARGET% tools_mingw90 qt.tools.win64_mingw900
2032
aqt install-tool --outputdir %QT_INSTALL_DIR% %QT_HOST% %QT_TARGET% tools_cmake
2133
aqt install-tool --outputdir %QT_INSTALL_DIR% %QT_HOST% %QT_TARGET% tools_ninja
2234
aqt install-tool --outputdir %QT_INSTALL_DIR% %QT_HOST% %QT_TARGET% tools_openssl_x64
2335

36+
:cache_hit
37+
38+
REM Debug info
39+
echo Debug info
40+
dir %QT_INSTALL_DIR%\Tools
41+
2442
REM Set env variables with path
2543
set "PATH=%QT_INSTALL_DIR%\%QT%\%QT_ARCH_PATH%\bin;%PATH%"
26-
set "PATH=%QT_INSTALL_DIR%\Tools\mingw810_64\bin;%PATH%"
44+
set "PATH=%QT_INSTALL_DIR%\Tools\mingw1120_64\bin;%PATH%"
2745
set "PATH=%QT_INSTALL_DIR%\Tools\CMake_64\bin;%PATH%"
2846
set "PATH=%QT_INSTALL_DIR%\Tools\Ninja;%PATH%"
2947

3048
set "QT_PLUGIN_PATH=%QT_INSTALL_DIR%\%QT%\%QT_ARCH_PATH%\plugins\"
3149
set "QML_IMPORT_PATH=%QT_INSTALL_DIR%\%QT%\%QT_ARCH_PATH%\qml\"
3250
set "QML2_IMPORT_PATH=%QT_INSTALL_DIR%\%QT%\%QT_ARCH_PATH%\qml\"
33-
set "CMAKE_PREFIX_PATH=%QT_INSTALL_DIR%\%QT%\%QT_ARCH_PATH%\lib\cmake\Qt5"
51+
set "CMAKE_PREFIX_PATH=%QT_INSTALL_DIR%\%QT%\%QT_ARCH_PATH%\lib\cmake\Qt6"
3452

3553
set "OPENSSL_DIR=%QT_INSTALL_DIR%\Tools\OpenSSL\Win_x64\bin"

0 commit comments

Comments
 (0)