Move GetCreateRuleVariable to cmGeneratorTarget.

This commit is contained in:
Stephen Kelly 2012-09-16 01:19:54 +02:00
parent 78bfee35d5
commit 9facfd1336
5 changed files with 25 additions and 24 deletions

View File

@ -336,3 +336,22 @@ void cmGeneratorTarget::GetAppleArchs(const char* config,
cmSystemTools::ExpandListArgument(std::string(archs), archVec);
}
}
//----------------------------------------------------------------------------
const char* cmGeneratorTarget::GetCreateRuleVariable()
{
switch(this->GetType())
{
case cmTarget::STATIC_LIBRARY:
return "_CREATE_STATIC_LIBRARY";
case cmTarget::SHARED_LIBRARY:
return "_CREATE_SHARED_LIBRARY";
case cmTarget::MODULE_LIBRARY:
return "_CREATE_SHARED_MODULE";
case cmTarget::EXECUTABLE:
return "_LINK_EXECUTABLE";
default:
break;
}
return "";
}

View File

@ -69,6 +69,11 @@ public:
void GetAppleArchs(const char* config,
std::vector<std::string>& archVec);
///! Return the rule variable used to create this type of target,
// need to add CMAKE_(LANG) for full name.
const char* GetCreateRuleVariable();
private:
void ClassifySources();
void LookupObjectLibraries();

View File

@ -670,7 +670,7 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang,
}
std::string createRule = "CMAKE_";
createRule += llang;
createRule += target.Target->GetCreateRuleVariable();
createRule += target.GetCreateRuleVariable();
std::string targetName = target.Target->GetFullName();
// Executable :
// Shared Library:

View File

@ -2952,25 +2952,6 @@ void cmTarget::ComputeLinkClosure(const char* config, LinkClosure& lc)
}
}
//----------------------------------------------------------------------------
const char* cmTarget::GetCreateRuleVariable()
{
switch(this->GetType())
{
case cmTarget::STATIC_LIBRARY:
return "_CREATE_STATIC_LIBRARY";
case cmTarget::SHARED_LIBRARY:
return "_CREATE_SHARED_LIBRARY";
case cmTarget::MODULE_LIBRARY:
return "_CREATE_SHARED_MODULE";
case cmTarget::EXECUTABLE:
return "_LINK_EXECUTABLE";
default:
break;
}
return "";
}
//----------------------------------------------------------------------------
const char* cmTarget::GetSuffixVariableInternal(bool implib)
{

View File

@ -320,10 +320,6 @@ public:
///! Return the preferred linker language for this target
const char* GetLinkerLanguage(const char* config = 0);
///! Return the rule variable used to create this type of target,
// need to add CMAKE_(LANG) for full name.
const char* GetCreateRuleVariable();
/** Get the full name of the target according to the settings in its
makefile. */
std::string GetFullName(const char* config=0, bool implib = false);