From d8bf317546bcfab0b6b50375218429fa9d470705 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 1 Oct 2013 12:34:20 +0200 Subject: make qreal double by default on all platforms On modern ARM CPUs there is no speed difference between float and double anymore, so let's rather use double for qreal to avoid rounding and precision issues. Like this we also get much better compatibility with our desktop OSes. This is not binary compatible on ARM, but the old behavior can be restored by passing -qreal float to configure. Change-Id: I2a4b61e19a3dfa6b0bd76734cecf2634c97207fc Reviewed-by: Thiago Macieira --- tools/configure/configureapp.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tools') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 5d4ce84941..4c323a3540 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -196,6 +196,7 @@ Configure::Configure(int& argc, char** argv) dictionary[ "SLOG2" ] = "no"; dictionary[ "SYSTEM_PROXIES" ] = "no"; dictionary[ "WERROR" ] = "auto"; + dictionary[ "QREAL" ] = "double"; //Only used when cross compiling. dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg"; @@ -418,6 +419,12 @@ void Configure::parseCmdLine() break; dictionary[ "QCONFIG" ] = configCmdLine.at(i); } + else if (configCmdLine.at(i) == "-qreal") { + ++i; + if (i == argCount) + break; + dictionary[ "QREAL" ] = configCmdLine.at(i); + } else if (configCmdLine.at(i) == "-release") { dictionary[ "BUILD" ] = "release"; @@ -1876,6 +1883,9 @@ bool Configure::displayHelp() desc("PROCESS", "full", "-fully-process", "Generate Makefiles/Project files for the entire Qt\ntree."); desc("PROCESS", "no", "-dont-process", "Do not generate Makefiles/Project files.\n"); + desc( "-qreal [double|float]", "typedef qreal to the specified type. The default is double.\n" + "Note that changing this flag affects binary compatibility.\n"); + desc("RTTI", "no", "-no-rtti", "Do not compile runtime type information."); desc("RTTI", "yes", "-rtti", "Compile runtime type information."); desc("STRIP", "no", "-no-strip", "Do not strip libraries and executables of debug info when installing."); @@ -3298,6 +3308,8 @@ void Configure::generateConfigfiles() if (dictionary[ "NEON" ] == "yes") tmpStream << "#define QT_COMPILER_SUPPORTS_NEON" << endl; + if (dictionary["QREAL"] != "double") + tmpStream << "#define QT_COORD_TYPE " << dictionary["QREAL"] << endl; tmpStream << endl << "// Compile time features" << endl; -- cgit v1.2.3