From 6c8e59d6942b3fcc4201e77bcc2d4ecc01168b10 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Jul 2014 14:24:33 +0200 Subject: ensure that arch_host.pro is used also on windows Change-Id: I110ec33a40f37ecdec5ab952ea56a4fc00cd27a8 Reviewed-by: David Schulz --- tools/configure/configureapp.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 63d9f2804e..f40c1ac615 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3090,13 +3090,14 @@ void Configure::generateCachefile() } struct ArchData { + bool isHost; const char *qmakespec; const char *key; const char *subarchKey; const char *type; ArchData() {} - ArchData(const char *t, const char *qm, const char *k, const char *sak) - : qmakespec(qm), key(k), subarchKey(sak), type(t) + ArchData(bool h, const char *t, const char *qm, const char *k, const char *sak) + : isHost(h), qmakespec(qm), key(k), subarchKey(sak), type(t) {} }; @@ -3122,8 +3123,8 @@ void Configure::detectArch() QVector qmakespecs; if (dictionary.contains("XQMAKESPEC")) - qmakespecs << ArchData("target", "XQMAKESPEC", "QT_ARCH", "QT_CPU_FEATURES"); - qmakespecs << ArchData("host", "QMAKESPEC", "QT_HOST_ARCH", "QT_HOST_CPU_FEATURES"); + qmakespecs << ArchData(false, "target", "XQMAKESPEC", "QT_ARCH", "QT_CPU_FEATURES"); + qmakespecs << ArchData(true, "host", "QMAKESPEC", "QT_HOST_ARCH", "QT_HOST_CPU_FEATURES"); for (int i = 0; i < qmakespecs.count(); ++i) { const ArchData &data = qmakespecs.at(i); @@ -3135,7 +3136,8 @@ void Configure::detectArch() QString command = QString("%1 -spec %2 %3") .arg(QDir::toNativeSeparators(buildPath + "/bin/qmake.exe"), QDir::toNativeSeparators(qmakespec), - QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch.pro")); + QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch" + + (data.isHost ? "_host" : "") + ".pro")); if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone")) command.append(" QMAKE_LFLAGS+=/ENTRY:main"); -- cgit v1.2.3 From ae496a0ea6c0951e9220209b345fb656bf50c09e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Jul 2014 14:42:58 +0200 Subject: add /ENTRY:main only for target builds Change-Id: Ifa1d36607a1884ec989b5b514e7d1b9a2b40ddce Reviewed-by: David Schulz Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- tools/configure/configureapp.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index f40c1ac615..76b2b9073c 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3139,8 +3139,10 @@ void Configure::detectArch() QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch" + (data.isHost ? "_host" : "") + ".pro")); - if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone")) - command.append(" QMAKE_LFLAGS+=/ENTRY:main"); + if (!data.isHost) { + if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone")) + command.append(" QMAKE_LFLAGS+=/ENTRY:main"); + } int returnValue = 0; Environment::execute(command, &returnValue); -- cgit v1.2.3 From ffd44acd0de4fc7079e76f1fe4689b655f9dc763 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Jul 2014 14:43:18 +0200 Subject: pass --sysroot to compile tests also on windows Change-Id: I486059197479842f32c3590d7fd269550d22698e Reviewed-by: David Schulz Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- tools/configure/configureapp.cpp | 11 +++++++++++ tools/configure/configureapp.h | 1 + 2 files changed, 12 insertions(+) (limited to 'tools') 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); -- cgit v1.2.3