summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Hoosier <matt.hoosier@garmin.com>2013-10-17 08:47:46 -0500
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-22 12:15:57 +0200
commit163bbeb2181bc66683bb836542dc1ea2bcded1fd (patch)
tree9c7c775320f265204906bb4ea9afa9ceac4d3432
parent377c7575a7e8acc6030520cb36fe66da3ce43a93 (diff)
Detect pointer size at configure-time on Windows-hosted builds
The configure-time procedure used on Windows does not currently perform the same tests to determine the width of a pointer as are performed on Unix-based builds. This causes QT_POINTER_SIZE to be undefined in the generated qconfig.h file. This in turn breaks compilation of various Qt modules such as QtDeclarative. This patch adds the same level of support for automatically determining the target platform's pointer size, as is currently offered to Unix users. Change-Id: I93838c1759b14089ba9f4daf442048fb5c8da738 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r--config.tests/unix/ptrsize/ptrsizetest.pro1
-rw-r--r--tools/configure/configureapp.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/config.tests/unix/ptrsize/ptrsizetest.pro b/config.tests/unix/ptrsize/ptrsizetest.pro
index 045a759ec9..a7ae38a5d9 100644
--- a/config.tests/unix/ptrsize/ptrsizetest.pro
+++ b/config.tests/unix/ptrsize/ptrsizetest.pro
@@ -1,2 +1,3 @@
SOURCES = ptrsizetest.cpp
CONFIG -= qt dylib
+CONFIG += debug console
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 757de7b3b0..c3382a5e0a 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2353,6 +2353,11 @@ void Configure::autoDetection()
if (i.value() == "auto")
i.value() = defaultTo(i.key());
}
+
+ if (tryCompileProject("unix/ptrsize"))
+ dictionary["QT_POINTER_SIZE"] = "8";
+ else
+ dictionary["QT_POINTER_SIZE"] = "4";
}
bool Configure::verifyConfiguration()
@@ -3411,6 +3416,8 @@ void Configure::generateConfigfiles()
if (dictionary["REDUCE_RELOCATIONS"] == "yes") qconfigList += "QT_REDUCE_RELOCATIONS";
if (dictionary["QT_GETIFADDRS"] == "no") qconfigList += "QT_NO_GETIFADDRS";
+ qconfigList += QString("QT_POINTER_SIZE=%1").arg(dictionary["QT_POINTER_SIZE"]);
+
qconfigList.sort();
for (int i = 0; i < qconfigList.count(); ++i)
tmpStream << addDefine(qconfigList.at(i));