From d3e638fcbddce4a13d75a25101766f40d8a82b9f Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 18 Dec 2018 11:03:56 -0800 Subject: [PATCH] dependencies/ui: Fix Qt pkg-config detection on MacOS Since 0.46.1 pkg-config detection has been broken using the qt from homebrew, due to a bug in homebrew (I think). Tested with qt 5.12.0 on Mojave. --- mesonbuild/dependencies/ui.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py index 1f65c3b86..326c72e2d 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py @@ -288,7 +288,15 @@ class QtBaseDependency(ExternalDependency): self.compile_args += m.get_compile_args() if self.private_headers: qt_inc_dir = m.get_pkgconfig_variable('includedir', dict()) - mod_private_inc = _qt_get_private_includes(os.path.join(qt_inc_dir, 'Qt' + m_name), m_name, m.version) + mod_private_dir = os.path.join(qt_inc_dir, 'Qt' + m_name) + if not os.path.isdir(mod_private_dir): + # At least some versions of homebrew don't seem to set this + # up correctly. /usr/local/opt/qt/include/Qt + m_name is a + # symlink to /usr/local/opt/qt/include, but the pkg-config + # file points to /usr/local/Cellar/qt/x.y.z/Headers/, and + # the Qt + m_name there is not a symlink, it's a file + mod_private_dir = qt_inc_dir + mod_private_inc = _qt_get_private_includes(mod_private_dir, m_name, m.version) for dir in mod_private_inc: self.compile_args.append('-I' + dir) self.link_args += m.get_link_args()