summaryrefslogtreecommitdiff
path: root/src/plugins/qbsprojectmanager
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-08-15 13:53:28 +0200
committerEike Ziller <eike.ziller@qt.io>2018-08-15 13:53:28 +0200
commitdb9837fa6c9401e898ac8e7492081a6e21c71790 (patch)
treed542a089711257402ac4fe70813fa0e7de825f2e /src/plugins/qbsprojectmanager
parent7bc14bf3498ea6b1c19abacf85a5103772da26bc (diff)
parent58747b2de107e8f6ac00daeb431ecbf3e603fd34 (diff)
downloadqt-creator-db9837fa6c9401e898ac8e7492081a6e21c71790.tar.gz
Merge remote-tracking branch 'origin/4.7'
Conflicts: src/plugins/clangtools/clangtoolruncontrol.cpp src/plugins/cpptools/compileroptionsbuilder.cpp Change-Id: Ib1e8abf066898b50c90fc1ccba4697fe983e8a8f
Diffstat (limited to 'src/plugins/qbsprojectmanager')
-rw-r--r--src/plugins/qbsprojectmanager/qbsproject.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp
index 5740483c27..22fcfc9dfa 100644
--- a/src/plugins/qbsprojectmanager/qbsproject.cpp
+++ b/src/plugins/qbsprojectmanager/qbsproject.cpp
@@ -822,13 +822,15 @@ static void getExpandedCompilerFlags(QStringList &cFlags, QStringList &cxxFlags,
}
cFlags = cxxFlags = commonFlags;
- const QString cxxLanguageVersion = getCppProp("cxxLanguageVersion").toString();
- if (cxxLanguageVersion == "c++11")
- cxxFlags << "-std=c++0x";
- else if (cxxLanguageVersion == "c++14")
- cxxFlags << "-std=c++1y";
+ const auto cxxLanguageVersion = getCppProp("cxxLanguageVersion").toStringList();
+ if (cxxLanguageVersion.contains("c++17"))
+ cxxFlags << "-std=c++17";
+ else if (cxxLanguageVersion.contains("c++14"))
+ cxxFlags << "-std=c++14";
+ else if (cxxLanguageVersion.contains("c++11"))
+ cxxFlags << "-std=c++11";
else if (!cxxLanguageVersion.isEmpty())
- cxxFlags << ("-std=" + cxxLanguageVersion);
+ cxxFlags << ("-std=" + cxxLanguageVersion.first());
const QString cxxStandardLibrary = getCppProp("cxxStandardLibrary").toString();
if (!cxxStandardLibrary.isEmpty() && toolchain.contains("clang"))
cxxFlags << ("-stdlib=" + cxxStandardLibrary);
@@ -839,11 +841,13 @@ static void getExpandedCompilerFlags(QStringList &cFlags, QStringList &cxxFlags,
if (enableRtti.isValid())
cxxFlags << QLatin1String(enableRtti.toBool() ? "-frtti" : "-fno-rtti");
- const QString cLanguageVersion = getCppProp("cLanguageVersion").toString();
- if (cLanguageVersion == "c11")
- cFlags << "-std=c1x";
+ const auto cLanguageVersion = getCppProp("cLanguageVersion").toStringList();
+ if (cLanguageVersion.contains("c11"))
+ cFlags << "-std=c11";
+ else if (cLanguageVersion.contains("c99"))
+ cFlags << "-std=c99";
else if (!cLanguageVersion.isEmpty())
- cFlags << ("-std=" + cLanguageVersion);
+ cFlags << ("-std=" + cLanguageVersion.first());
} else if (toolchain.contains("msvc")) {
if (enableExceptions.toBool()) {
const QString exceptionModel = getCppProp("exceptionHandlingModel").toString();
@@ -859,6 +863,8 @@ static void getExpandedCompilerFlags(QStringList &cFlags, QStringList &cxxFlags,
cxxFlags << "/TP";
if (enableRtti.isValid())
cxxFlags << QLatin1String(enableRtti.toBool() ? "/GR" : "/GR-");
+ if (getCppProp("cxxLanguageVersion").toStringList().contains("c++17"))
+ cxxFlags << "/std:c++17";
}
}