waf: upgrade to 2.0.21
[vlendec/samba-autobuild/.git] / third_party / waf / waflib / Tools / qt5.py
index 99e021bae6124a51de111620188d8325c2be1cce..cff2028174fa194c7cdc29c7bdd06be71b81474e 100644 (file)
@@ -57,7 +57,23 @@ A few options (--qt{dir,bin,...}) and environment variables
 (QT5_{ROOT,DIR,MOC,UIC,XCOMPILE}) allow finer tuning of the tool,
 tool path selection, etc; please read the source for more info.
 
-The detection uses pkg-config on Linux by default. To force static library detection use:
+The detection uses pkg-config on Linux by default. The list of
+libraries to be requested to pkg-config is formulated by scanning
+in the QTLIBS directory (that can be passed via --qtlibs or by
+setting the environment variable QT5_LIBDIR otherwise is derived
+by querying qmake for QT_INSTALL_LIBS directory) for shared/static
+libraries present.
+Alternatively the list of libraries to be requested via pkg-config
+can be set using the qt5_vars attribute, ie:
+
+      conf.qt5_vars = ['Qt5Core', 'Qt5Gui', 'Qt5Widgets', 'Qt5Test'];
+
+This can speed up configuration phase if needed libraries are
+known beforehand, can improve detection on systems with a
+sparse QT5 libraries installation (ie. NIX) and can improve
+detection of some header-only Qt modules (ie. Qt5UiPlugin).
+
+To force static library detection use:
 QT5_XCOMPILE=1 QT5_FORCE_STATIC=1 waf configure
 """
 
@@ -466,6 +482,9 @@ def configure(self):
 
        The detection uses the program ``pkg-config`` through :py:func:`waflib.Tools.config_c.check_cfg`
        """
+       if 'COMPILER_CXX' not in self.env:
+               self.fatal('No CXX compiler defined: did you forget to configure compiler_cxx first?')
+
        self.find_qt5_binaries()
        self.set_qt5_libs_dir()
        self.set_qt5_libs_to_check()
@@ -478,9 +497,6 @@ def configure(self):
        if not has_xml:
                Logs.error('No xml.sax support was found, rcc dependencies will be incomplete!')
 
-       if 'COMPILER_CXX' not in self.env:
-               self.fatal('No CXX compiler defined: did you forget to configure compiler_cxx first?')
-
        # Qt5 may be compiled with '-reduce-relocations' which requires dependent programs to have -fPIE or -fPIC?
        frag = '#include <QMap>\nint main(int argc, char **argv) {QMap<int,int> m;return m.keys().size();}\n'
        uses = 'QT5CORE'
@@ -637,7 +653,7 @@ def set_qt5_libs_dir(self):
                except Errors.WafError:
                        qtdir = self.cmd_and_log(env.QMAKE + ['-query', 'QT_INSTALL_PREFIX']).strip()
                        qtlibs = os.path.join(qtdir, 'lib')
-       self.msg('Found the Qt5 libraries in', qtlibs)
+       self.msg('Found the Qt5 library path', qtlibs)
        env.QTLIBS = qtlibs
 
 @conf