forked from qt-creator/qt-creator
MSVC: Also understand the "-D" syntax
... when filtering defines from the compiler command line. Fixes: QTCREATORBUG-24985 Change-Id: I28b06aa640638578d384f744c63d1430cb4b99bd Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -592,10 +592,10 @@ Macros MsvcToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
|
||||
|
||||
QStringList toProcess;
|
||||
for (const QString &arg : cxxflags) {
|
||||
if (arg.startsWith(QLatin1String("/D"))) {
|
||||
if (arg.startsWith("/D") || arg.startsWith("-D")) {
|
||||
const QString define = arg.mid(2);
|
||||
predefinedMacros.append(Macro::fromKeyValue(define));
|
||||
} else if (arg.startsWith(QLatin1String("/U"))) {
|
||||
} else if (arg.startsWith("/U") || arg.startsWith("-U")) {
|
||||
predefinedMacros.append(
|
||||
{arg.mid(2).toLocal8Bit(), ProjectExplorer::MacroType::Undefine});
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user