diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-10-01 12:34:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-31 22:01:40 +0100 |
commit | d8bf317546bcfab0b6b50375218429fa9d470705 (patch) | |
tree | 91bfee6bbf56d25002d819c46e5778e49d3c4679 /tools/configure | |
parent | e696bef863ba4cc21a36cbfdc0d6e811060916f7 (diff) |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'tools/configure')
-rw-r--r-- | tools/configure/configureapp.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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; |