From: Nirbheek Chauhan Date: Mon, 1 Apr 2019 12:50:28 +0000 (+0530) Subject: meson: Only ensure that moc is available on Linux X-Git-Tag: 1.19.3~509^2~1109 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f23724b8a6f790fee3c8da37c84865b37a67fafe;p=platform%2Fupstream%2Fgstreamer.git meson: Only ensure that moc is available on Linux On other OSes, it's not possible to have qmake or the qt5 pkg-config files and not have moc, and `moc` will not be in `PATH`, so this only causes problems. --- diff --git a/ext/qt/meson.build b/ext/qt/meson.build index 690d01e..c29dc93 100644 --- a/ext/qt/meson.build +++ b/ext/qt/meson.build @@ -20,8 +20,18 @@ if have_cxx and build_gstgl qt5qml_dep = dependency('qt5', modules : ['Core', 'Gui', 'Qml', 'Quick'], required: get_option('qt5'), static: host_machine.system() == 'ios') - # FIXME Add a way to get that information out of the qt5 module - moc = find_program('moc-qt5', 'moc', required : get_option('qt5')) + # On Linux, distros often have the Qt5 pkg-config files and moc in separate + # packages, so the user may not have both installed. Check for moc and ensure + # that it's installed. + # We don't do this check on other OSes because they need to be able to simply + # point the `QMAKE` env var to `qmake` to build against a particular Qt5. + if host_system == 'linux' + moc = find_program('moc-qt5', 'moc', required : get_option('qt5')) + else + # We only check if `moc` was found, and then discard it, so we can fake it. + # This is also a good unit test of the fact that we *don't* use it. + moc = declare_dependency() + endif if qt5qml_dep.found() and moc.found() optional_deps = [] qt_defines = []