diff options
-rw-r--r-- | tools/configure/configureapp.cpp | 11 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 76b2b9073c..90981f6624 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3089,6 +3089,15 @@ void Configure::generateCachefile() } } +void Configure::addSysroot(QString *command) +{ + const QString &sysroot = dictionary["CFG_SYSROOT"]; + if (!sysroot.isEmpty() && dictionary["CFG_GCC_SYSROOT"] == "yes") { + command->append(" QMAKE_LFLAGS+=--sysroot=" + sysroot); + command->append(" QMAKE_CXXFLAGS+=--sysroot=" + sysroot); + } +} + struct ArchData { bool isHost; const char *qmakespec; @@ -3142,6 +3151,7 @@ void Configure::detectArch() if (!data.isHost) { if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone")) command.append(" QMAKE_LFLAGS+=/ENTRY:main"); + addSysroot(&command); } int returnValue = 0; @@ -3249,6 +3259,7 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext const QString qmakespec = dictionary["XQMAKESPEC"]; if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone")) command.append(" QMAKE_LFLAGS+=/ENTRY:main"); + addSysroot(&command); } int code = 0; diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 5f118ddd39..faa9c1eb14 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -169,6 +169,7 @@ private: void reloadCmdLine(); void saveCmdLine(); + void addSysroot(QString *command); bool tryCompileProject(const QString &projectPath, const QString &extraOptions = QString()); bool compilerSupportsFlag(const QString &compilerAndArgs); |