diff options
author | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2010-08-31 18:12:30 (GMT) |
---|---|---|
committer | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2010-09-02 10:56:33 (GMT) |
commit | ac33c5ba3206ac7bb1d38c796139d864a637f7a4 (patch) | |
tree | 9ce506487ab4cce6b31dfb2904b54b061fab3289 | |
parent | a1e1103e1c3f0e47c5d075660a77d00f47e1c125 (diff) | |
download | Qt-ac33c5ba3206ac7bb1d38c796139d864a637f7a4.zip Qt-ac33c5ba3206ac7bb1d38c796139d864a637f7a4.tar.gz Qt-ac33c5ba3206ac7bb1d38c796139d864a637f7a4.tar.bz2 |
Add option to enable -MP compile option for MSVC
The option is on when building Qt, but off by default for other
projects, due to potential incompatible compile options in other
projects. (/E, /EP, /Gm, /Yc, /showIncludes, #import preprocessor
directive)
Reviewed-by: bhughes
Reviewed-by: ossi
-rw-r--r-- | mkspecs/features/win32/msvc_mp.prf | 2 | ||||
-rw-r--r-- | mkspecs/win32-msvc2008/qmake.conf | 2 | ||||
-rw-r--r-- | mkspecs/win32-msvc2010/qmake.conf | 2 | ||||
-rw-r--r-- | tools/configure/configureapp.cpp | 14 |
4 files changed, 19 insertions, 1 deletions
diff --git a/mkspecs/features/win32/msvc_mp.prf b/mkspecs/features/win32/msvc_mp.prf new file mode 100644 index 0000000..d6dea14 --- /dev/null +++ b/mkspecs/features/win32/msvc_mp.prf @@ -0,0 +1,2 @@ +QMAKE_CFLAGS += $$QMAKE_CFLAGS_MP +QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_MP diff --git a/mkspecs/win32-msvc2008/qmake.conf b/mkspecs/win32-msvc2008/qmake.conf index 9805e90..9a69aaa 100644 --- a/mkspecs/win32-msvc2008/qmake.conf +++ b/mkspecs/win32-msvc2008/qmake.conf @@ -23,6 +23,7 @@ QMAKE_CFLAGS_RELEASE = -O2 -MD QMAKE_CFLAGS_DEBUG = -Zi -MDd QMAKE_CFLAGS_YACC = QMAKE_CFLAGS_LTCG = -GL +QMAKE_CFLAGS_MP = -MP QMAKE_CXX = $$QMAKE_CC QMAKE_CXXFLAGS = $$QMAKE_CFLAGS @@ -32,6 +33,7 @@ QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG +QMAKE_CXXFLAGS_MP = $$QMAKE_CFLAGS_MP QMAKE_CXXFLAGS_STL_ON = -EHsc QMAKE_CXXFLAGS_STL_OFF = QMAKE_CXXFLAGS_RTTI_ON = -GR diff --git a/mkspecs/win32-msvc2010/qmake.conf b/mkspecs/win32-msvc2010/qmake.conf index 28d4d3c..8331c14 100644 --- a/mkspecs/win32-msvc2010/qmake.conf +++ b/mkspecs/win32-msvc2010/qmake.conf @@ -23,6 +23,7 @@ QMAKE_CFLAGS_RELEASE = -O2 -MD QMAKE_CFLAGS_DEBUG = -Zi -MDd QMAKE_CFLAGS_YACC = QMAKE_CFLAGS_LTCG = -GL +QMAKE_CFLAGS_MP = -MP QMAKE_CXX = $$QMAKE_CC QMAKE_CXXFLAGS = $$QMAKE_CFLAGS @@ -32,6 +33,7 @@ QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG +QMAKE_CXXFLAGS_MP = $$QMAKE_CFLAGS_MP QMAKE_CXXFLAGS_STL_ON = -EHsc QMAKE_CXXFLAGS_STL_OFF = QMAKE_CXXFLAGS_RTTI_ON = -GR diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 09da581..89d3ef0 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -381,6 +381,7 @@ Configure::Configure(int& argc, char** argv) dictionary[ "INCREDIBUILD_XGE" ] = "auto"; dictionary[ "LTCG" ] = "no"; dictionary[ "NATIVE_GESTURES" ] = "yes"; + dictionary[ "MSVC_MP" ] = "no"; } Configure::~Configure() @@ -534,6 +535,13 @@ void Configure::parseCmdLine() else if (configCmdLine.at(i) == "-no-ltcg") { dictionary[ "LTCG" ] = "no"; } + else if (configCmdLine.at(i) == "-mp") { + dictionary[ "MSVC_MP" ] = "yes"; + } + else if (configCmdLine.at(i) == "-no-mp") { + dictionary[ "MSVC_MP" ] = "no"; + } + #endif else if (configCmdLine.at(i) == "-platform") { @@ -1848,6 +1856,8 @@ bool Configure::displayHelp() desc("STYLE_S60" , "yes", "", " s60\n", ' '); desc("NATIVE_GESTURES", "no", "-no-native-gestures", "Do not use native gestures on Windows 7."); desc("NATIVE_GESTURES", "yes", "-native-gestures", "Use native gestures on Windows 7."); + desc("MSVC_MP", "no", "-no-mp", "Do not use multiple processors for compiling with MSVC"); + desc("MSVC_MP", "yes", "-mp", "Use multiple processors for compiling with MSVC (-MP)"); /* We do not support -qconfig on Windows yet @@ -2822,7 +2832,7 @@ void Configure::generateCachefile() for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var) { cacheStream << (*var) << endl; } - cacheStream << "CONFIG += " << qmakeConfig.join(" ") << " incremental create_prl link_prl depend_includepath QTDIR_build" << endl; + cacheStream << "CONFIG += " << qmakeConfig.join(" ") << " incremental msvc_mp create_prl link_prl depend_includepath QTDIR_build" << endl; QStringList buildParts; buildParts << "libs" << "tools" << "examples" << "demos" << "docs" << "translations"; @@ -2885,6 +2895,8 @@ void Configure::generateCachefile() if (dictionary[ "LTCG" ] == "yes") configStream << " ltcg"; + if (dictionary[ "MSVC_MP" ] == "yes") + configStream << " msvc_mp"; if (dictionary[ "STL" ] == "yes") configStream << " stl"; if (dictionary[ "EXCEPTIONS" ] == "yes") |