From 58b373c9e3c0a7307e3fbafeb5ad710088b8e685 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 2 Mar 2018 12:30:44 +0100 Subject: Make sure $$relative_path() uses an absolute path as its first arg Thanks to QTBUG-61373, this qmake function was called with /usr/local/5.10.1 as baseDir, which isn't absolute, leading to an assertion failure. We could raise the error within qmake but it proved easier to simply resolve any non-absolute baseDir using PWD, before trying to use it as an absolute path. Did the same for $$absolute_path(). Documented both. Adjusted the assert that caught this to report any non-absolute path that upsets it. Added simple tests, fixed an existing test. Task-number: QTBUG-66156 Change-Id: Icfef2e2f5b236e071177c9beffa38d71bf404292 Reviewed-by: Oswald Buddenhagen --- qmake/library/ioutils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake/library/ioutils.cpp') diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp index afd41912fe..cb4aa5e74d 100644 --- a/qmake/library/ioutils.cpp +++ b/qmake/library/ioutils.cpp @@ -103,7 +103,7 @@ QString IoUtils::resolvePath(const QString &baseDir, const QString &fileName) return QDir::cleanPath(fileName); #ifdef Q_OS_WIN // Add drive to otherwise-absolute path: if (fileName.at(0).unicode() == '/' || fileName.at(0).unicode() == '\\') { - Q_ASSERT(isAbsolutePath(baseDir)); + Q_ASSERT_X(isAbsolutePath(baseDir), "IoUtils::resolvePath", qUtf8Printable(baseDir)); return QDir::cleanPath(baseDir.left(2) + fileName); } #endif // Q_OS_WIN -- cgit v1.2.3