GenericProject: Changed the way C++11 is specified

Pass it as compiler flag, which makes sure that not only cxxVersion
is set correctly (depending on the compiler) but that also the
toolchainDefines are the right ones for C++11 (most significantly,
the value of __cplusplus which affects STL features).

Change-Id: I53dd543b30b7fc2824283ec119d7d5261f50f130
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Thorbjørn Lindeijer
2014-05-28 00:04:13 +02:00
parent 38e61ea552
commit 997eb98eb2

View File

@@ -252,12 +252,14 @@ void GenericProject::refresh(RefreshOptions options)
Kit *k = activeTarget() ? activeTarget()->kit() : KitManager::defaultKit();
if (ToolChain *tc = ToolChainKitInformation::toolChain(k)) {
QStringList cxxflags; // FIXME: Can we do better?
part->evaluateToolchain(tc, cxxflags, cxxflags,
QStringList cflags;
QStringList cxxflags;
cxxflags << QLatin1String("-std=c++11");
part->evaluateToolchain(tc, cxxflags, cflags,
SysRootKitInformation::sysRoot(k));
}
part->cxxVersion = CppTools::ProjectPart::CXX11; // assume C++11
part->projectConfigFile = configFileName();
// ### add _defines.