Skip to content

Commit

Permalink
Build with Qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
z3ntu committed Nov 9, 2024
1 parent fea6761 commit 31df567
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 28 deletions.
16 changes: 7 additions & 9 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ os: Visual Studio 2022

environment:
matrix:
- arch: x86
compiler: msvc2019
- arch: x64
compiler: msvc2019

Expand All @@ -12,8 +10,8 @@ platform:

install:
# Set paths to dependencies (based on architecture)
- cmd: if %arch%==x86 (set PYTHON_ROOT=C:\python312) else (set PYTHON_ROOT=C:\python312-x64)
- cmd: if %arch%==x86 (set QT_ROOT=C:\Qt\5.15\%compiler%) else (set QT_ROOT=C:\Qt\5.15\%compiler%_64)
- cmd: set PYTHON_ROOT=C:\python312-x64
- cmd: set QT_ROOT=C:\Qt\6.5\%compiler%_64
# Print out dependency paths
- cmd: echo Using Python at %PYTHON_ROOT%
- cmd: echo Using Qt at %QT_ROOT%
Expand All @@ -33,11 +31,11 @@ after_build:
# Zip build binaries and dependencies
- cmd: mkdir .\RazerGenie
- cmd: copy %APPVEYOR_BUILD_FOLDER%\builddir\src\RazerGenie.exe .\RazerGenie\
- cmd: copy %QT_ROOT%\bin\Qt5Core.dll .\RazerGenie\
- cmd: copy %QT_ROOT%\bin\Qt5DBus.dll .\RazerGenie\
- cmd: copy %QT_ROOT%\bin\Qt5Gui.dll .\RazerGenie\
- cmd: copy %QT_ROOT%\bin\Qt5Network.dll .\RazerGenie\
- cmd: copy %QT_ROOT%\bin\Qt5Widgets.dll .\RazerGenie\
- cmd: copy %QT_ROOT%\bin\Qt6Core.dll .\RazerGenie\
- cmd: copy %QT_ROOT%\bin\Qt6DBus.dll .\RazerGenie\
- cmd: copy %QT_ROOT%\bin\Qt6Gui.dll .\RazerGenie\
- cmd: copy %QT_ROOT%\bin\Qt6Network.dll .\RazerGenie\
- cmd: copy %QT_ROOT%\bin\Qt6Widgets.dll .\RazerGenie\
- cmd: mkdir .\RazerGenie\platforms
- cmd: copy %QT_ROOT%\plugins\platforms\qwindows.dll .\RazerGenie\platforms
- cmd: 7z a RazerGenie_%compiler%_%arch%.zip .\RazerGenie\*
Expand Down
4 changes: 2 additions & 2 deletions .builds/alpine.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
image: alpine/edge
packages:
- meson
- qt5-qtbase-dev
- qt5-qttools-dev
- qt6-qtbase-dev
- qt6-qttools-dev
sources:
- https://github.com/z3ntu/RazerGenie
tasks:
Expand Down
14 changes: 4 additions & 10 deletions .builds/freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@ image: freebsd/latest
packages:
- meson
- pkgconf
- qt5-buildtools
- qt5-dbus
- qt5-gui
- qt5-linguisttools
- qt5-network
- qt5-testlib
- qt5-widgets
- qt5-xml
- qt6-base
- qt6-tools
sources:
- https://github.com/z3ntu/RazerGenie
tasks:
# Qt5Gui depends on GL/gl.h but it isn't present in the pkgconfig file
# Qt6Gui depends on GL/gl.h but it isn't present in the pkgconfig file
- prepare: |
sudo sed -i '' 's|Cflags:|Cflags: -I${prefix}/include|' /usr/local/libdata/pkgconfig/Qt5Gui.pc
sudo sed -i '' 's|Cflags:|Cflags: -I${prefix}/include|' /usr/local/libdata/pkgconfig/Qt6Gui.pc
- setup: |
cd RazerGenie
meson setup builddir
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: brew install qt@5 meson svg2png
- run: echo "/opt/homebrew/opt/qt@5/bin" >> $GITHUB_PATH
- run: brew install qt@6 meson svg2png
- run: echo "/opt/homebrew/opt/qt@6/bin" >> $GITHUB_PATH
- run: meson setup builddir
- run: meson compile -C builddir
8 changes: 4 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
project('razergenie', 'cpp',
version : '1.1.0',
meson_version : '>=0.49.0',
default_options : ['cpp_std=c++11'])
meson_version : '>=0.57.0',
default_options : ['cpp_std=c++17'])

# Disable any API deprecated in 5.15 or older Qt versions
add_project_arguments('-DQT_DISABLE_DEPRECATED_BEFORE=0x050F00', language : 'cpp')

qt = import('qt5')
qt_dep = dependency('qt5', modules: ['Core', 'DBus', 'Gui', 'Network', 'Widgets'])
qt = import('qt6')
qt_dep = dependency('qt6', modules: ['Core', 'DBus', 'Gui', 'Network', 'Widgets'])

libopenrazer_dep = dependency('libopenrazer', version : '>=0.2.0', fallback : ['libopenrazer', 'libopenrazer_dep'])

Expand Down
2 changes: 1 addition & 1 deletion subprojects/libopenrazer.wrap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[wrap-git]
directory = libopenrazer
url = https://github.com/z3ntu/libopenrazer.git
revision = head
revision = qt6

0 comments on commit 31df567

Please sign in to comment.