Skip to content

Commit 30de4a0

Browse files
committed
Migrate to Qt6.5 + add WASM build (#274)
* Migrate to Qt6 + WASM * format * wasm * bump ubuntu version
1 parent 17e6946 commit 30de4a0

Some content is hidden

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

43 files changed

+356
-171
lines changed

.github/workflows/linux-release.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
name: Ubuntu 18.04 / Qt 5.15
1+
name: Ubuntu 20.04 / Qt 6.5.0
22
on:
33
workflow_run:
44
workflows: ["Release setup"]
55
types: [completed]
66

77
jobs:
88
buildUbuntuXenial:
9-
runs-on: ubuntu-18.04
9+
runs-on: ubuntu-20.04
1010
env:
1111
CC: gcc-9
1212
CXX: g++-9
1313

14-
strategy:
14+
strateg
1515
matrix:
1616
build-type: [Release, Debug]
1717

@@ -33,22 +33,18 @@ jobs:
3333
libxcb-xinerama0 libxcb-composite0 libxcb-cursor0 libxcb-damage0 \
3434
libxcb-dpms0 libxcb-dri2-0 libxcb-dri3-0 libxcb-ewmh2 libxcb-glx0 \
3535
libxcb-present0 libxcb-randr0 libxcb-record0 libxcb-render0 libxcb-res0 \
36-
libxcb-screensaver0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1
36+
libxcb-screensaver0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 libegl1
3737
38-
- name: Cache Qt
39-
id: cache-qt
40-
uses: actions/cache@v1
38+
- name: Install Qt
39+
uses: jurplel/install-qt-action@v3
4140
with:
42-
path: ../Qt
43-
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}
44-
45-
- name: install Qt
46-
uses: jurplel/install-qt-action@v2
47-
with:
48-
version: '5.15.2'
49-
modules: 'qtcharts qtsvg'
50-
install-deps: false
51-
cached: ${{ steps.cache-qt.outputs.cache-hit }}
41+
aqtversion: '==3.1.*'
42+
py7zrversion: '>=0.20.2'
43+
version: '6.5.0'
44+
host: 'linux'
45+
target: 'desktop'
46+
arch: 'gcc_64'
47+
modules: 'qtcharts'
5248

5349
- name: checkout sources
5450
uses: actions/checkout@v2

.github/workflows/mac-release.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Mac / Qt 5.15
1+
name: Mac / Qt 6.5.0
22
on:
33
workflow_run:
44
workflows: ["Release setup"]
@@ -22,20 +22,16 @@ jobs:
2222
- name: setup Homebrew
2323
run: brew install autoconf automake libtool xz pkg-config libgit2 libjpg libpng libmtp svg2png
2424

25-
- name: Cache Qt
26-
id: cache-qt
27-
uses: actions/cache@v1
25+
- name: Install Qt
26+
uses: jurplel/install-qt-action@v3
2827
with:
29-
path: ../Qt
30-
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}
31-
32-
- name: install Qt
33-
uses: jurplel/install-qt-action@v2
34-
with:
35-
version: '5.15.2'
36-
modules: 'qtcharts qtsvg'
37-
install-deps: false
38-
cached: ${{ steps.cache-qt.outputs.cache-hit }}
28+
aqtversion: '==3.1.*'
29+
py7zrversion: '>=0.20.2'
30+
version: '6.5.0'
31+
host: 'mac'
32+
target: 'desktop'
33+
arch: 'clang_64'
34+
modules: 'qtcharts'
3935

4036
- name: build Ripes
4137
run: |

.github/workflows/test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-18.04]
15+
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-20.04]
1616

1717
steps:
1818
- uses: actions/checkout@v2
@@ -57,18 +57,18 @@ jobs:
5757
# Qt installation
5858
- if: "!contains(matrix.os, 'windows')"
5959
name: install Qt
60-
uses: jurplel/install-qt-action@v2
60+
uses: jurplel/install-qt-action@v3
6161
with:
62-
version: '5.15.2'
63-
modules: 'qtcharts qtsvg'
62+
version: '6.5.0'
63+
modules: 'qtcharts'
6464
install-deps: false
6565

6666
- if: contains( matrix.os, 'windows')
6767
name: install Qt (Windows)
68-
uses: jurplel/install-qt-action@v2
68+
uses: jurplel/install-qt-action@v3
6969
with:
70-
version: '5.15.2'
71-
modules: 'qtcharts qtsvg'
70+
version: '6.5.0'
71+
modules: 'qtcharts'
7272
install-deps: false
7373
arch: win64_msvc2019_64
7474

.github/workflows/wasm-release.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: WASM / Qt 6.5.0
2+
on:
3+
push:
4+
branches:
5+
- '*'
6+
7+
jobs:
8+
buildUbuntuXenial:
9+
runs-on: ubuntu-20.04
10+
env:
11+
CC: emcc
12+
CXX: em++
13+
14+
strategy:
15+
matrix:
16+
build-type: [Release]
17+
18+
steps:
19+
20+
- name: Job info
21+
run: |
22+
echo "GitHub Ref: ${{ github.ref }}"
23+
echo "Event: ${{ github.event }}"
24+
25+
- name: get container ready for build
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get upgrade -y
29+
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y -q --force-yes \
30+
automake cmake git wget libfuse2 desktop-file-utils tree \
31+
build-essential libgl1-mesa-dev libxkbcommon-x11-0 libpulse-dev \
32+
libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 \
33+
libxcb-xinerama0 libxcb-composite0 libxcb-cursor0 libxcb-damage0 \
34+
libxcb-dpms0 libxcb-dri2-0 libxcb-dri3-0 libxcb-ewmh2 libxcb-glx0 \
35+
libxcb-present0 libxcb-randr0 libxcb-record0 libxcb-render0 libxcb-res0 \
36+
libxcb-screensaver0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 libegl1 libegl1-mesa-dev
37+
38+
- name: checkout sources
39+
uses: actions/checkout@v2
40+
with:
41+
submodules: recursive
42+
fetch-depth: 0
43+
44+
- name: Install Qt (Host)
45+
uses: jurplel/install-qt-action@v3
46+
with:
47+
aqtversion: '==3.1.*'
48+
py7zrversion: '>=0.20.2'
49+
version: '6.5.0'
50+
host: 'linux'
51+
target: 'desktop'
52+
arch: 'gcc_64'
53+
cache: 'true'
54+
cache-key-prefix: 'install-qt-host-6.5.0'
55+
modules: 'qtcharts'
56+
57+
- name: Install Qt (Emscripten)
58+
uses: jurplel/install-qt-action@v3
59+
with:
60+
aqtversion: '==3.1.*'
61+
py7zrversion: '>=0.20.2'
62+
version: '6.5.0'
63+
host: 'linux'
64+
target: 'desktop'
65+
arch: 'wasm_multithread'
66+
modules: 'qtcharts'
67+
cache: 'true'
68+
cache-key-prefix: 'install-qt-emscripten-6.5.0'
69+
70+
- name: install Emscripten
71+
run: |
72+
git clone https://github.com/emscripten-core/emsdk.git
73+
cd emsdk
74+
./emsdk install latest 3.1.25
75+
./emsdk activate 3.1.25
76+
77+
- name: build Ripes
78+
run: |
79+
echo "building desktop"
80+
source emsdk/emsdk_env.sh
81+
export QT_HOST_PATH=$(pwd)/../Qt/6.5.0/gcc_64/
82+
find ${QT_HOST_PATH}
83+
cmake \
84+
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
85+
-DRIPES_WITH_QPROCESS=OFF \
86+
-DEMSCRIPTEN=1 \
87+
-DQT_HOST_PATH="${QT_HOST_PATH}" \
88+
-DCMAKE_TOOLCHAIN_FILE=$(pwd)/../Qt/6.5.0/wasm_multithread/lib/cmake/Qt6/qt.toolchain.cmake \
89+
-DCMAKE_PREFIX_PATH=$(pwd)/../Qt/6.5.0/wasm_multithread/ \
90+
-DEMSCRIPTEN_FORCE_COMPILERS=ON \
91+
.
92+
make -j $(nproc)
93+
94+
- uses: actions/upload-artifact@v2
95+
with:
96+
name: ${{ matrix.build-type }}_wasm
97+
path: |
98+
Ripes.wasm
99+
Ripes.js
100+
Ripes.worker.js
101+
qtloader.js
102+
103+
# Dispatch the publish.yml workflow over at mortbopet.github.io
104+
- run: |
105+
gh workflow run publish.yml -R mortbopet/mortbopet.github.io --ref master
106+
env:
107+
GH_TOKEN: ${{ secrets.MORTBOPET_GITHUB_IO_TOKEN }}

.github/workflows/windows-release.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Windows / Qt 5.15
1+
name: Windows / Qt 6.5.0
22
on:
33
workflow_run:
44
workflows: ["Release setup"]
@@ -17,21 +17,16 @@ jobs:
1717
uses: ilammy/msvc-dev-cmd@v1
1818
- uses: seanmiddleditch/gha-setup-ninja@master
1919

20-
- name: Cache Qt
21-
id: cache-qt
22-
uses: actions/cache@v1
20+
- name: Install Qt
21+
uses: jurplel/install-qt-action@v3
2322
with:
24-
path: ../Qt
25-
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}
26-
27-
- name: install Qt
28-
uses: jurplel/install-qt-action@v2
29-
with:
30-
version: '5.15.2'
31-
modules: 'qtcharts qtsvg'
32-
install-deps: false
33-
arch: win64_msvc2019_64
34-
cached: ${{ steps.cache-qt.outputs.cache-hit }}
23+
aqtversion: '==3.1.*'
24+
py7zrversion: '>=0.20.2'
25+
version: '6.5.0'
26+
host: 'windows'
27+
target: 'desktop'
28+
arch: 'win64_msvc2019_64'
29+
modules: 'qtcharts'
3530

3631
- name: checkout sources
3732
uses: actions/checkout@v2

CMakeLists.txt

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.13)
22
set(CMAKE_CXX_STANDARD 17)
33
set(CMAKE_CXX_STANDARD_REQUIRED ON)
44
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
5+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
6+
7+
message(status "QT_HOST_PATH = ${QT_HOST_PATH}")
8+
59

610
find_program(CCACHE_PROGRAM ccache)
711
if(CCACHE_PROGRAM)
@@ -42,24 +46,27 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
4246
set(CMAKE_AUTOUIC ON)
4347
set(CMAKE_AUTORCC ON)
4448

49+
set(RIPES_WITH_QPROCESS ON CACHE BOOL "Build with QProcess-related utilities")
50+
# Add as a C++ definition
51+
if(RIPES_WITH_QPROCESS)
52+
add_definitions(-DRIPES_WITH_QPROCESS)
53+
endif()
54+
4555
# Find required Qt packages
46-
find_package(Qt5Core REQUIRED)
47-
find_package(Qt5Widgets CONFIG REQUIRED)
48-
find_package(Qt5Svg REQUIRED)
49-
find_package(Qt5Charts CONFIG REQUIRED)
56+
find_package(Qt6 COMPONENTS Core Widgets Svg Charts REQUIRED)
5057

5158
# Finding Qt includes
52-
include_directories(${Qt5Widgets_INCLUDE_DIRS})
53-
include_directories(${Qt5Core_INCLUDE_DIRS})
54-
include_directories(${Qt5Charts_INCLUDE_DIRS})
59+
include_directories(${Qt6Widgets_INCLUDE_DIRS})
60+
include_directories(${Qt6Core_INCLUDE_DIRS})
61+
include_directories(${Qt6Charts_INCLUDE_DIRS})
5562

5663
######################################################################
5764
## Resources setup
5865
######################################################################
59-
qt5_add_resources(ICONS_SRC ${CMAKE_SOURCE_DIR}/resources/icons/icons.qrc)
60-
qt5_add_resources(EXAMPLES_SRC ${CMAKE_SOURCE_DIR}/examples/examples.qrc)
61-
qt5_add_resources(LAYOUTS_SRC ${CMAKE_SOURCE_DIR}/src/processors/layouts.qrc)
62-
qt5_add_resources(FONTS_SRC ${CMAKE_SOURCE_DIR}/resources/fonts/fonts.qrc)
66+
qt6_add_resources(ICONS_SRC ${CMAKE_SOURCE_DIR}/resources/icons/icons.qrc)
67+
qt6_add_resources(EXAMPLES_SRC ${CMAKE_SOURCE_DIR}/examples/examples.qrc)
68+
qt6_add_resources(LAYOUTS_SRC ${CMAKE_SOURCE_DIR}/src/processors/layouts.qrc)
69+
qt6_add_resources(FONTS_SRC ${CMAKE_SOURCE_DIR}/resources/fonts/fonts.qrc)
6370

6471
######################################################################
6572
## Library setup
@@ -109,12 +116,19 @@ if(RIPES_BUILD_TESTS)
109116
endif()
110117

111118
set(APP_NAME Ripes)
112-
add_executable(${APP_NAME} ${SYSTEM_FLAGS} ${ICONS_SRC} ${EXAMPLES_SRC} ${LAYOUTS_SRC} ${FONTS_SRC} main.cpp)
119+
qt_add_executable(${APP_NAME} ${SYSTEM_FLAGS} ${ICONS_SRC} ${EXAMPLES_SRC} ${LAYOUTS_SRC} ${FONTS_SRC} main.cpp)
113120

114121
# Link Qt libraries
115-
target_link_libraries(${APP_NAME} Qt5::Core Qt5::Widgets)
122+
target_link_libraries(${APP_NAME} PUBLIC Qt6::Core Qt6::Widgets)
116123
# Link Ripes library
117-
target_link_libraries(${APP_NAME} ${RIPES_LIB})
124+
target_link_libraries(${APP_NAME} PUBLIC ${RIPES_LIB})
125+
126+
if(${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
127+
# https://doc.qt.io/qt-6/wasm.html#asyncify
128+
target_link_options(${RIPES_LIB} PUBLIC -sASYNCIFY -Os)
129+
target_link_options(${APP_NAME} PUBLIC -sASYNCIFY -Os)
130+
endif()
131+
118132

119133
if(UNIX AND NOT APPLE) #Define the LINUX variable before testing it
120134
set(LINUX TRUE)

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Ripes
2-
[![Windows / Qt 5.15](https://github.com/mortbopet/Ripes/actions/workflows/windows-release.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/windows-release.yml)
3-
[![Mac release / Qt 5.15](https://github.com/mortbopet/Ripes/actions/workflows/mac-release.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/mac-release.yml)
4-
[![Ubuntu release 16.04 / Qt 5.15](https://github.com/mortbopet/Ripes/actions/workflows/linux-release.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/linux-release.yml)
2+
[![Windows / Qt 6.5.0](https://github.com/mortbopet/Ripes/actions/workflows/windows-release.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/windows-release.yml)
3+
[![Mac release / Qt 6.5.0](https://github.com/mortbopet/Ripes/actions/workflows/mac-release.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/mac-release.yml)
4+
[![Ubuntu release 16.04 / Qt 6.5.0](https://github.com/mortbopet/Ripes/actions/workflows/linux-release.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/linux-release.yml)
55
[![Ripes CI tests](https://github.com/mortbopet/Ripes/actions/workflows/test.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/test.yml)
66
[![Gitter](https://badges.gitter.im/Ripes-VSRTL/Ripes.svg)](https://gitter.im/Ripes-VSRTL/)
77

@@ -40,8 +40,9 @@ For Windows, the C++ runtime library must be available (if not, a msvcp140.dll e
4040

4141
## Building
4242
Initially, the following dependencies must be made available:
43-
- A recent (>=5.15) version of [Qt](https://www.qt.io/download) + Qt Charts (**not** bundled with Qt by default, but can be selected during Qt installation)
43+
- A recent (>=6.5.0) version of [Qt](https://www.qt.io/download) + Qt Charts (**not** bundled with Qt by default, but can be selected during Qt installation)
4444
- [CMake](https://cmake.org/)
45+
- `sudo apt-get install libegl1-mesa-dev`
4546

4647
Then, Ripes can be checked out and built as a standard CMake project:
4748
```

0 commit comments

Comments
 (0)