diff options
author | Brad King <brad.king@kitware.com> | 2012-08-22 14:49:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-22 15:12:32 (GMT) |
commit | 9b2dda5db57415e6f8b910e0fa3d770ec478e9f3 (patch) | |
tree | 6af4f19dcfafe776e2d8dd799e3fb686a46fa5b5 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 4cb99b1dbc3932a74a7c34b0b31187e0e913d625 (diff) | |
download | CMake-9b2dda5db57415e6f8b910e0fa3d770ec478e9f3.zip CMake-9b2dda5db57415e6f8b910e0fa3d770ec478e9f3.tar.gz CMake-9b2dda5db57415e6f8b910e0fa3d770ec478e9f3.tar.bz2 |
VS11: Generate flag tables from MSBuild V110 tool files
Run cmparseMSBuildXML.py on cl.xml, lib.xml, and link.xml to generate
our flag tables:
python cmparseMSBuildXML.py -x ".../MSBuild/Microsoft.Cpp/v4.0/V110/1033/cl.xml" > cmVS11CLFlagTable.h
python cmparseMSBuildXML.py -x ".../MSBuild/Microsoft.Cpp/v4.0/V110/1033/lib.xml" > cmVS11LibFlagTable.h
python cmparseMSBuildXML.py -x ".../MSBuild/Microsoft.Cpp/v4.0/V110/1033/link.xml" > cmVS11LinkFlagTable.h
Fix up the declaration names at the top of each file. Finally, teach
cmVisualStudio10TargetGenerator to select the version of the table
matching the version of VS.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 53b6a9b..c7d2706 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, "&", "&"); @@ -957,7 +984,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()); @@ -1151,7 +1178,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; @@ -1311,7 +1338,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, " ", ""); @@ -1391,7 +1418,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"; |