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