Fix parsing of the /utf8 MSVC compiler flag in VS project generator

Adding the /utf8 compiler flag resulted in undefining all preprocessor
symbols for VS project files, because the ingenious compiler option
parsing logic checked for a 'u' prefix, and "utf8" obviously matched.

The /utf8 flag is added to the additional options, because there doesn't
seem to be an XML tag for that.

Task-number: QTBUG-59431
Change-Id: I762fcdcf6caf0606b40633861e265df5edb4a9c4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Joerg Bornemann 2017-03-13 13:24:48 +01:00
parent 16d1ddfc42
commit 70e772079f

View File

@ -1153,7 +1153,12 @@ bool VCCLCompilerTool::parseOption(const char* option)
}
found = false; break;
case 'u':
UndefineAllPreprocessorDefinitions = _True;
if (!second)
UndefineAllPreprocessorDefinitions = _True;
else if (second == 't' && third == 'f' && fourth == '8')
AdditionalOptions += option;
else
found = false;
break;
case 'v':
if(second == 'd' || second == 'm') {