Use a proper test for absolute path for qmake's location
QFileInfo.isRelative() deems any path starting with a slash to be absolute; on MS-Win, such paths need a drive specifier (unless they're UNC), so use IoUtils's more robust test for absolute paths. Change-Id: I7d0872a87833cbf1cc1a6ef107941adc4c529624 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
f9b8ea4b0e
commit
957c1d9abd
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "option.h"
|
#include "option.h"
|
||||||
#include "cachekeys.h"
|
#include "cachekeys.h"
|
||||||
|
#include <ioutils.h>
|
||||||
#include <qdir.h>
|
#include <qdir.h>
|
||||||
#include <qregexp.h>
|
#include <qregexp.h>
|
||||||
#include <qhash.h>
|
#include <qhash.h>
|
||||||
@ -38,6 +39,8 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
using namespace QMakeInternal;
|
||||||
|
|
||||||
EvalHandler Option::evalHandler;
|
EvalHandler Option::evalHandler;
|
||||||
QMakeGlobals *Option::globals;
|
QMakeGlobals *Option::globals;
|
||||||
ProFileCache *Option::proFileCache;
|
ProFileCache *Option::proFileCache;
|
||||||
@ -325,7 +328,7 @@ Option::init(int argc, char **argv)
|
|||||||
#endif
|
#endif
|
||||||
if(Option::qmake_mode == Option::QMAKE_GENERATE_NOTHING)
|
if(Option::qmake_mode == Option::QMAKE_GENERATE_NOTHING)
|
||||||
Option::qmake_mode = default_mode(argv0);
|
Option::qmake_mode = default_mode(argv0);
|
||||||
if(!argv0.isEmpty() && !QFileInfo(argv0).isRelative()) {
|
if (!argv0.isEmpty() && IoUtils::isAbsolutePath(argv0)) {
|
||||||
globals->qmake_abslocation = argv0;
|
globals->qmake_abslocation = argv0;
|
||||||
} else if (argv0.contains(QLatin1Char('/'))
|
} else if (argv0.contains(QLatin1Char('/'))
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
Loading…
x
Reference in New Issue
Block a user