Support meson builds with QT6

This commit is contained in:
Pau RE
2024-12-29 15:23:00 +01:00
parent 6c8b195d00
commit 768fbe237b
4 changed files with 16 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ SET "BUILDDIR=build_%PLATFORM%"
ECHO Preparing directory
CD src
meson --buildtype=release ..\%BUILDDIR%
meson --buildtype=release %* ..\%BUILDDIR%
CD ..\%BUILDDIR%
ninja -j4
if %ERRORLEVEL% NEQ 0 (

0
scripts/meson_parse_qmake.py Normal file → Executable file
View File

View File

@@ -8,7 +8,12 @@ project('iaito', 'cpp',
# 'optimization=3',
# 'buildtype=debugoptimized'])
qt5_mod = import('qt5')
if get_option('with_qt6')
qt_mod = import('qt6')
else
qt_mod = import('qt5')
endif
py3_exe = import('python').find_installation('python3')
qt_modules = []
@@ -106,9 +111,14 @@ else
default_options : ['enable_tests=false'])
endif
qt5dep = dependency('qt5', modules: qt_modules, main: true)
if get_option('with_qt6')
qt_modules += 'SvgWidgets'
qtdep = dependency('qt6', modules: qt_modules, main: true)
else
qtdep = dependency('qt5', modules: qt_modules, main: true)
endif
deps = [r_core, qt5dep]
deps = [r_core, qtdep]
# if get_option('enable_python')
# py3_dep = dependency('python3')
# deps += [py3_dep]
@@ -139,7 +149,7 @@ deps = [r_core, qt5dep]
# endif
# endif
moc_files = qt5_mod.preprocess(
moc_files = qt_mod.preprocess(
moc_headers: headers,
ui_files: ui_files,
qresources: qresources,

View File

@@ -1,3 +1,4 @@
# both options are deprecated
# option('enable_python', type: 'boolean', value: false)
# option('enable_python_bindings', type: 'boolean', value: false)
option('with_qt6', type: 'boolean', value: false)