From 07eb80d9104402e00355af7cce7192df7f4819ef Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Sun, 28 Jun 2009 08:59:56 -0400 Subject: [PATCH] ENH: fix line length --- Source/cmVisualStudio10TargetGenerator.cxx | 37 ++++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 4c9d289d9..cd96a7566 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -26,6 +26,7 @@ #include "cmVS10CLFlagTable.h" #include "cmVS10LinkFlagTable.h" +#include "cmVS10LibFlagTable.h" @@ -395,8 +396,8 @@ void cmVisualStudio10TargetGenerator::WriteCLSources() for(std::vector::const_iterator source = sources.begin(); source != sources.end(); ++source) { - // if it is not a custom command then add it as a c file, - // TODO: need to check for idl or rc, or exclude from build + // if it is not a custom command then add it as a c/c++ file, + // TODO: need to check for idl or rc if(!(*source)->GetCustomCommand() && !(*source)->GetPropertyAsBool("HEADER_FILE_ONLY") && !this->GlobalGenerator->IgnoreFile @@ -508,8 +509,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( clOptions.SetConfiguration((*config).c_str()); clOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", ""); clOptions.OutputFlagMap(*this->BuildFileStream, " "); - clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ", - "\n"); + clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, + " ", "\n"); } } @@ -740,6 +741,29 @@ WriteRCOptions(std::string const& , } +void cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& + ) +{ + if(this->Target->GetType() != cmTarget::STATIC_LIBRARY) + { + return; + } + if(const char* libflags = this->Target + ->GetProperty("STATIC_LIBRARY_FLAGS")) + { + this->WriteString("\n", 2); + cmVisualStudioGeneratorOptions + libOptions(this->LocalGenerator, + 10, cmVisualStudioGeneratorOptions::Compiler, + cmVS10LibFlagTable, 0, this); + libOptions.Parse(libflags); + libOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", ""); + libOptions.OutputFlagMap(*this->BuildFileStream, " "); + this->WriteString("\n", 2); + } +} + + void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& config) { @@ -974,9 +998,10 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups() } // output midl flags this->WriteMidlOptions(*i, includes); - // output link flags or + // output link flags this->WriteLinkOptions(*i); - // TODO: need a WriteLibOptions for static + // output lib flags + this->WriteLibOptions(*i); this->WriteString("\n", 1); } }