Fix classical strcmp misuse in VS project generator

The conditions were wrong, they must compare against zero.
Also, use qstricmp to avoid the platform #ifdef.

Change-Id: I7e5ef1b9ae8e2e1d3d9ce90a645ee568b370ab57
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Joerg Bornemann 2019-08-23 08:47:31 +02:00
parent 96ff6e8ebe
commit 92f4523c8a

View File

@ -1567,21 +1567,12 @@ bool VCLinkerTool::parseOption(const char* option)
const char* str = option+6; const char* str = option+6;
if (*str == 'S') if (*str == 'S')
ShowProgress = linkProgressAll; ShowProgress = linkProgressAll;
#ifndef Q_OS_WIN else if (qstricmp(str, "pginstrument") == 0)
else if (strncasecmp(str, "pginstrument", 12))
LinkTimeCodeGeneration = optLTCGInstrument; LinkTimeCodeGeneration = optLTCGInstrument;
else if (strncasecmp(str, "pgoptimize", 10)) else if (qstricmp(str, "pgoptimize") == 0)
LinkTimeCodeGeneration = optLTCGOptimize; LinkTimeCodeGeneration = optLTCGOptimize;
else if (strncasecmp(str, "pgupdate", 8 )) else if (qstricmp(str, "pgupdate") == 0)
LinkTimeCodeGeneration = optLTCGUpdate; LinkTimeCodeGeneration = optLTCGUpdate;
#else
else if (_stricmp(str, "pginstrument"))
LinkTimeCodeGeneration = optLTCGInstrument;
else if (_stricmp(str, "pgoptimize"))
LinkTimeCodeGeneration = optLTCGOptimize;
else if (_stricmp(str, "pgupdate"))
LinkTimeCodeGeneration = optLTCGUpdate;
#endif
} }
} else { } else {
AdditionalOptions.append(option); AdditionalOptions.append(option);