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>
This commit is contained in:
Matt Hoosier 2013-10-17 08:47:46 -05:00 committed by The Qt Project
parent 377c7575a7
commit 163bbeb218
2 changed files with 8 additions and 0 deletions

View File

@ -1,2 +1,3 @@
SOURCES = ptrsizetest.cpp SOURCES = ptrsizetest.cpp
CONFIG -= qt dylib CONFIG -= qt dylib
CONFIG += debug console

View File

@ -2353,6 +2353,11 @@ void Configure::autoDetection()
if (i.value() == "auto") if (i.value() == "auto")
i.value() = defaultTo(i.key()); i.value() = defaultTo(i.key());
} }
if (tryCompileProject("unix/ptrsize"))
dictionary["QT_POINTER_SIZE"] = "8";
else
dictionary["QT_POINTER_SIZE"] = "4";
} }
bool Configure::verifyConfiguration() bool Configure::verifyConfiguration()
@ -3411,6 +3416,8 @@ void Configure::generateConfigfiles()
if (dictionary["REDUCE_RELOCATIONS"] == "yes") qconfigList += "QT_REDUCE_RELOCATIONS"; if (dictionary["REDUCE_RELOCATIONS"] == "yes") qconfigList += "QT_REDUCE_RELOCATIONS";
if (dictionary["QT_GETIFADDRS"] == "no") qconfigList += "QT_NO_GETIFADDRS"; if (dictionary["QT_GETIFADDRS"] == "no") qconfigList += "QT_NO_GETIFADDRS";
qconfigList += QString("QT_POINTER_SIZE=%1").arg(dictionary["QT_POINTER_SIZE"]);
qconfigList.sort(); qconfigList.sort();
for (int i = 0; i < qconfigList.count(); ++i) for (int i = 0; i < qconfigList.count(); ++i)
tmpStream << addDefine(qconfigList.at(i)); tmpStream << addDefine(qconfigList.at(i));