VS: Split flag table between v140 and v141 toolsets

In commit v3.7.0-rc1~156^2~1 (VS: Update v140 flag tables from VS 15
MSBuild files, 2016-09-02) we extended the v140 flag table with values
from the v141 toolset that comes with VS 15.  However, the v140 toolset
that comes with VS 14 does not have all of these entries and so the
flags just need to be passed without special mapping.  In order to
support both toolsets, split our CL flag table into separate copies for
each version and switch off the toolset name.

Closes: #16352
This commit is contained in:
Brad King
2016-10-10 11:12:36 -04:00
parent b99bbfe88d
commit b1d67ae8a5
3 changed files with 247 additions and 3 deletions
+9 -2
View File
@@ -25,7 +25,8 @@
#include "cmVS12LinkFlagTable.h"
#include "cmVS12MASMFlagTable.h"
#include "cmVS12RCFlagTable.h"
#include "cmVS14CLFlagTable.h"
#include "cmVS140CLFlagTable.h"
#include "cmVS141CLFlagTable.h"
#include "cmVS14LibFlagTable.h"
#include "cmVS14LinkFlagTable.h"
#include "cmVS14MASMFlagTable.h"
@@ -43,7 +44,13 @@ cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetClFlagTable() const
cmGlobalVisualStudioGenerator::VSVersion v =
this->LocalGenerator->GetVersion();
if (v >= cmGlobalVisualStudioGenerator::VS14) {
return cmVS14CLFlagTable;
// FIXME: All flag table selection should be based on the toolset name.
// See issue #16153. For now, treat VS 15's toolset as a special case.
const char* toolset = this->GlobalGenerator->GetPlatformToolset();
if (toolset && cmHasLiteralPrefix(toolset, "v141")) {
return cmVS141CLFlagTable;
}
return cmVS140CLFlagTable;
} else if (v >= cmGlobalVisualStudioGenerator::VS12) {
return cmVS12CLFlagTable;
} else if (v == cmGlobalVisualStudioGenerator::VS11) {