STYLE: Separate unrelated logic

This separates unrelated uses of a library-type switch into separate
switches.  An upcoming commit will conditionally enter one of the
switches.
This commit is contained in:
Brad King 2009-03-16 16:55:53 -04:00
parent 2f651c2e59
commit 49dec94f54
1 changed files with 12 additions and 3 deletions

View File

@ -451,18 +451,15 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
// Add the link message. // Add the link message.
std::string buildEcho = "Linking "; std::string buildEcho = "Linking ";
buildEcho += linkLanguage; buildEcho += linkLanguage;
const char* forbiddenFlagVar = 0;
switch(this->Target->GetType()) switch(this->Target->GetType())
{ {
case cmTarget::STATIC_LIBRARY: case cmTarget::STATIC_LIBRARY:
buildEcho += " static library "; buildEcho += " static library ";
break; break;
case cmTarget::SHARED_LIBRARY: case cmTarget::SHARED_LIBRARY:
forbiddenFlagVar = "_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS";
buildEcho += " shared library "; buildEcho += " shared library ";
break; break;
case cmTarget::MODULE_LIBRARY: case cmTarget::MODULE_LIBRARY:
forbiddenFlagVar = "_CREATE_SHARED_MODULE_FORBIDDEN_FLAGS";
buildEcho += " shared module "; buildEcho += " shared module ";
break; break;
default: default:
@ -473,6 +470,18 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
this->LocalGenerator->AppendEcho(commands, buildEcho.c_str(), this->LocalGenerator->AppendEcho(commands, buildEcho.c_str(),
cmLocalUnixMakefileGenerator3::EchoLink); cmLocalUnixMakefileGenerator3::EchoLink);
const char* forbiddenFlagVar = 0;
switch(this->Target->GetType())
{
case cmTarget::SHARED_LIBRARY:
forbiddenFlagVar = "_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS";
break;
case cmTarget::MODULE_LIBRARY:
forbiddenFlagVar = "_CREATE_SHARED_MODULE_FORBIDDEN_FLAGS";
break;
default: break;
}
// Construct a list of files associated with this library that may // Construct a list of files associated with this library that may
// need to be cleaned. // need to be cleaned.
std::vector<std::string> libCleanFiles; std::vector<std::string> libCleanFiles;