summaryrefslogtreecommitdiffstats
path: root/tools/configure/configureapp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/configure/configureapp.cpp')
-rw-r--r--tools/configure/configureapp.cpp11
1 files changed, 11 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;