summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-08-24 18:25:12 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-08-24 18:25:12 (GMT)
commit4ac85d07766ff2bb51493b0f6ddcef2cb59805e4 (patch)
treeb1ae4d4126fcd0777a106ed3928013b7adc6ab8b /Source/cmVisualStudio10TargetGenerator.cxx
parent38876a39036eaa2bdcc187aac93c96c6e8d6c95f (diff)
parent9b2dda5db57415e6f8b910e0fa3d770ec478e9f3 (diff)
downloadCMake-4ac85d07766ff2bb51493b0f6ddcef2cb59805e4.zip
CMake-4ac85d07766ff2bb51493b0f6ddcef2cb59805e4.tar.gz
CMake-4ac85d07766ff2bb51493b0f6ddcef2cb59805e4.tar.bz2
Merge topic 'vs11-flag-table'
9b2dda5 VS11: Generate flag tables from MSBuild V110 tool files 4cb99b1 cmparseMSBuildXML: Include DisplayName in the output
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx35
1 files changed, 31 insertions, 4 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index d289695..3d2828d 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -22,9 +22,36 @@
#include "cmVS10CLFlagTable.h"
#include "cmVS10LinkFlagTable.h"
#include "cmVS10LibFlagTable.h"
+#include "cmVS11CLFlagTable.h"
+#include "cmVS11LinkFlagTable.h"
+#include "cmVS11LibFlagTable.h"
#include <cmsys/auto_ptr.hxx>
+static cmVS7FlagTable const*
+cmVSGetCLFlagTable(cmLocalVisualStudioGenerator* lg)
+{
+ if(lg->GetVersion() >= cmLocalVisualStudioGenerator::VS11)
+ { return cmVS11CLFlagTable; }
+ return cmVS10CLFlagTable;
+}
+
+static cmVS7FlagTable const*
+cmVSGetLibFlagTable(cmLocalVisualStudioGenerator* lg)
+{
+ if(lg->GetVersion() >= cmLocalVisualStudioGenerator::VS11)
+ { return cmVS11LibFlagTable; }
+ return cmVS10LibFlagTable;
+}
+
+static cmVS7FlagTable const*
+cmVSGetLinkFlagTable(cmLocalVisualStudioGenerator* lg)
+{
+ if(lg->GetVersion() >= cmLocalVisualStudioGenerator::VS11)
+ { return cmVS11LinkFlagTable; }
+ return cmVS10LinkFlagTable;
+}
+
static std::string cmVS10EscapeXML(std::string arg)
{
cmSystemTools::ReplaceString(arg, "&", "&amp;");
@@ -958,7 +985,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
cmVisualStudioGeneratorOptions
clOptions(this->LocalGenerator,
cmVisualStudioGeneratorOptions::Compiler,
- cmVS10CLFlagTable, 0, this);
+ cmVSGetCLFlagTable(this->LocalGenerator), 0, this);
clOptions.Parse(flags.c_str());
clOptions.AddDefines(configDefines.c_str());
clOptions.SetConfiguration((*config).c_str());
@@ -1152,7 +1179,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
cmsys::auto_ptr<Options> pOptions(
new Options(this->LocalGenerator, Options::Compiler,
- cmVS10CLFlagTable));
+ cmVSGetCLFlagTable(this->LocalGenerator)));
Options& clOptions = *pOptions;
std::string flags;
@@ -1313,7 +1340,7 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
cmVisualStudioGeneratorOptions
libOptions(this->LocalGenerator,
cmVisualStudioGeneratorOptions::Linker,
- cmVS10LibFlagTable, 0, this);
+ cmVSGetLibFlagTable(this->LocalGenerator), 0, this);
libOptions.Parse(libflags?libflags:"");
libOptions.Parse(libflagsConfig?libflagsConfig:"");
libOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
@@ -1393,7 +1420,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
cmVisualStudioGeneratorOptions
linkOptions(this->LocalGenerator,
cmVisualStudioGeneratorOptions::Linker,
- cmVS10LinkFlagTable, 0, this);
+ cmVSGetLinkFlagTable(this->LocalGenerator), 0, this);
if ( this->Target->GetPropertyAsBool("WIN32_EXECUTABLE") )
{
flags += " /SUBSYSTEM:WINDOWS";