summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-10-10 15:12:36 (GMT)
committerBrad King <brad.king@kitware.com>2016-10-10 15:43:39 (GMT)
commitb1d67ae8a5a1334bfeaf802c55d517d8eaa0dbf9 (patch)
tree2bb1d9a93ff8f1df4d2a63773a4fae6a5805bc61 /Source/cmVisualStudio10TargetGenerator.cxx
parentb99bbfe88d1bb02dc903507f3e1bbe716ac04c12 (diff)
downloadCMake-b1d67ae8a5a1334bfeaf802c55d517d8eaa0dbf9.zip
CMake-b1d67ae8a5a1334bfeaf802c55d517d8eaa0dbf9.tar.gz
CMake-b1d67ae8a5a1334bfeaf802c55d517d8eaa0dbf9.tar.bz2
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
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index d81f59d..cb47f20 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -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) {