diff --git a/meson.build b/meson.build index f3b7e9e9ee..73c0bc2f23 100644 --- a/meson.build +++ b/meson.build @@ -884,9 +884,11 @@ if get_option('qtver') == 'qt5' add_global_arguments('-DQT_DISABLE_DEPRECATED_BEFORE=0x050b00', language : 'cpp') priv_conf_data.set('FC_QT5_MODE', 1) qt_opts = [] + qt_miver = '0x050b00' else add_global_arguments('-DQT_DISABLE_DEPRECATED_BEFORE=0x060000', language : 'cpp') qt_opts = 'cpp_std=c++17' + qt_minver = '0x060000' endif if get_option('audio') != 'none' @@ -3411,9 +3413,30 @@ else qt_dep = dependency('Qt5', modules: ['Core', 'Gui', 'Widgets'], required: false) endif +if qt_dep.found() and cxx_build + if cxx_compiler.compiles( +'''#include +int main() +{ +#if QT_VERSION < ''' + qt_minver + ''' + fail +#endif + return 0; +} +''', + name: 'qt minver', + dependencies: qt_dep) + qtfine = true + else + qtfine = false + endif +else + qtfine = false +endif + if get_option('clients').contains('qt') -if not qt_dep.found() +if not qtfine if get_option('qtver') == 'qt6' error('Qt6 >= 6.0 required for qt-client in Qt6 mode, but not found') else @@ -4075,7 +4098,7 @@ endif if get_option('fcmp').contains('qt') -if not qt_dep.found() +if not qtfine if get_option('qtver') == 'qt6' error('Qt6 >= 6.0 required for qt-modpack-installer in Qt6 mode, but not found') else @@ -4162,7 +4185,7 @@ endif if get_option('tools').contains('ruledit') -if not qt_dep.found() +if not qtfine if get_option('qtver') == 'qt6' error('Qt6 >= 6.0 required for ruledit in Qt6 mode, but not found') else