summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-07 22:26:50 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-14 22:41:40 (GMT)
commit55474e6182b49acc4183fffdebccc7ae2a7335fa (patch)
treefc5d65f70f0cc9159d93de0bfed3f4f913950096
parent38df5c36d66313a5dd7859c1c55a41f60f141b13 (diff)
downloadCMake-55474e6182b49acc4183fffdebccc7ae2a7335fa.zip
CMake-55474e6182b49acc4183fffdebccc7ae2a7335fa.tar.gz
CMake-55474e6182b49acc4183fffdebccc7ae2a7335fa.tar.bz2
cmState: Move GetTargetTypeName from cmTarget.
-rw-r--r--Source/cmComputeTargetDepends.cxx3
-rw-r--r--Source/cmCoreTryCompile.cxx2
-rw-r--r--Source/cmGeneratorTarget.cxx4
-rw-r--r--Source/cmLocalGenerator.cxx4
-rw-r--r--Source/cmMakefile.cxx2
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx7
-rw-r--r--Source/cmNinjaTargetGenerator.cxx3
-rw-r--r--Source/cmState.cxx27
-rw-r--r--Source/cmState.h2
-rw-r--r--Source/cmTarget.cxx29
-rw-r--r--Source/cmTarget.h1
11 files changed, 41 insertions, 43 deletions
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 138e630..f6de2ab 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -554,8 +554,7 @@ cmComputeTargetDepends
// Describe the depender.
e << " \"" << depender->GetName() << "\" of type "
- << cmTarget::GetTargetTypeName(
- depender->GetType()) << "\n";
+ << cmState::GetTargetTypeName(depender->GetType()) << "\n";
// List its dependencies that are inside the component.
EdgeList const& nl = this->InitialGraph[i];
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index de3f992..5bb0f99 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -107,7 +107,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
this->Makefile->IssueMessage(cmake::FATAL_ERROR,
"Only libraries may be used as try_compile or try_run IMPORTED "
"LINK_LIBRARIES. Got " + std::string(tgt->GetName()) + " of "
- "type " + tgt->GetTargetTypeName(tgt->GetType()) + ".");
+ "type " + cmState::GetTargetTypeName(tgt->GetType()) + ".");
return -1;
}
if (tgt->IsImported())
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index f5c5191..ba42591 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1965,7 +1965,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
std::string msg = "cmTarget::GetCompileInfo called for ";
msg += this->GetName();
msg += " which has type ";
- msg += cmTarget::GetTargetTypeName(this->GetType());
+ msg += cmState::GetTargetTypeName(this->GetType());
this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
return 0;
}
@@ -4697,7 +4697,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
std::string msg = "cmGeneratorTarget::GetOutputInfo called for ";
msg += this->GetName();
msg += " which has type ";
- msg += cmTarget::GetTargetTypeName(this->GetType());
+ msg += cmState::GetTargetTypeName(this->GetType());
this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
return 0;
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2a12f2b..5e0ea8b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -760,7 +760,7 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
}
if(variable == "TARGET_TYPE")
{
- return cmTarget::GetTargetTypeName(replaceValues.CMTarget->GetType());
+ return cmState::GetTargetTypeName(replaceValues.CMTarget->GetType());
}
}
if(replaceValues.Output)
@@ -2134,7 +2134,7 @@ void cmLocalGenerator
w <<
cmPolicies::GetPolicyWarning(cmPolicies::CMP0063) << "\n"
"Target \"" << target->GetName() << "\" of "
- "type \"" << cmTarget::GetTargetTypeName(target->GetType()) << "\" "
+ "type \"" << cmState::GetTargetTypeName(target->GetType()) << "\" "
"has the following visibility properties set for " << lang << ":\n" <<
warnCMP0063 <<
"For compatibility CMake is not honoring them for this target.";
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8f656b4..a1f143a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1426,7 +1426,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
{
std::ostringstream e;
e << "Target \"" << lib << "\" of type "
- << cmTarget::GetTargetTypeName(tgt->GetType())
+ << cmState::GetTargetTypeName(tgt->GetType())
<< " may not be linked into another target. "
<< "One may link only to STATIC or SHARED libraries, or "
<< "to executables with the ENABLE_EXPORTS property set.";
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index c5dfe2d..066c64e 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -103,7 +103,7 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules()
cmGlobalNinjaGenerator::WriteDivider(this->GetRulesFileStream());
this->GetRulesFileStream()
<< "# Rules for each languages for "
- << cmTarget::GetTargetTypeName(this->GetGeneratorTarget()->GetType())
+ << cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType())
<< " target "
<< this->GetTargetName()
<< "\n\n";
@@ -156,8 +156,7 @@ cmNinjaNormalTargetGenerator
{
return this->TargetLinkLanguage
+ "_"
- + cmTarget::GetTargetTypeName(
- this->GetGeneratorTarget()->GetType())
+ + cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType())
+ "_LINKER__"
+ cmGlobalNinjaGenerator::EncodeRuleName(this->GetTarget()->GetName())
;
@@ -446,7 +445,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
const cmState::TargetType targetType = target.GetType();
this->GetBuildFileStream()
<< "# Link build statements for "
- << cmTarget::GetTargetTypeName(targetType)
+ << cmState::GetTargetTypeName(targetType)
<< " target "
<< this->GetTargetName()
<< "\n\n";
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 0d6afff..63c1490 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -480,8 +480,7 @@ cmNinjaTargetGenerator
cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream());
this->GetBuildFileStream()
<< "# Object build statements for "
- << cmTarget::GetTargetTypeName(
- this->GetGeneratorTarget()->GetType())
+ << cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType())
<< " target "
<< this->GetTargetName()
<< "\n\n";
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 825204c..c491c7d 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -101,6 +101,33 @@ cmState::~cmState()
cmDeleteAll(this->Commands);
}
+const char* cmState::GetTargetTypeName(cmState::TargetType targetType)
+{
+ switch( targetType )
+ {
+ case cmState::STATIC_LIBRARY:
+ return "STATIC_LIBRARY";
+ case cmState::MODULE_LIBRARY:
+ return "MODULE_LIBRARY";
+ case cmState::SHARED_LIBRARY:
+ return "SHARED_LIBRARY";
+ case cmState::OBJECT_LIBRARY:
+ return "OBJECT_LIBRARY";
+ case cmState::EXECUTABLE:
+ return "EXECUTABLE";
+ case cmState::UTILITY:
+ return "UTILITY";
+ case cmState::GLOBAL_TARGET:
+ return "GLOBAL_TARGET";
+ case cmState::INTERFACE_LIBRARY:
+ return "INTERFACE_LIBRARY";
+ case cmState::UNKNOWN_LIBRARY:
+ return "UNKNOWN_LIBRARY";
+ }
+ assert(0 && "Unexpected target type");
+ return 0;
+}
+
const char* cmCacheEntryTypes[] =
{ "BOOL",
"PATH",
diff --git a/Source/cmState.h b/Source/cmState.h
index 0fe4812..7d1fc80 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -187,6 +187,8 @@ public:
INTERFACE_LIBRARY,
UNKNOWN_LIBRARY};
+ static const char* GetTargetTypeName(cmState::TargetType targetType);
+
Snapshot CreateBaseSnapshot();
Snapshot
CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index eeced8d..fecdc45 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -33,33 +33,6 @@
#define UNORDERED_SET std::set
#endif
-const char* cmTarget::GetTargetTypeName(cmState::TargetType targetType)
-{
- switch( targetType )
- {
- case cmState::STATIC_LIBRARY:
- return "STATIC_LIBRARY";
- case cmState::MODULE_LIBRARY:
- return "MODULE_LIBRARY";
- case cmState::SHARED_LIBRARY:
- return "SHARED_LIBRARY";
- case cmState::OBJECT_LIBRARY:
- return "OBJECT_LIBRARY";
- case cmState::EXECUTABLE:
- return "EXECUTABLE";
- case cmState::UTILITY:
- return "UTILITY";
- case cmState::GLOBAL_TARGET:
- return "GLOBAL_TARGET";
- case cmState::INTERFACE_LIBRARY:
- return "INTERFACE_LIBRARY";
- case cmState::UNKNOWN_LIBRARY:
- return "UNKNOWN_LIBRARY";
- }
- assert(0 && "Unexpected target type");
- return 0;
-}
-
//----------------------------------------------------------------------------
class cmTargetInternals
{
@@ -1892,7 +1865,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
// the type property returns what type the target is
else if (prop == propTYPE)
{
- return cmTarget::GetTargetTypeName(this->GetType());
+ return cmState::GetTargetTypeName(this->GetType());
}
else if(prop == propINCLUDE_DIRECTORIES)
{
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index e5646f6..c0b9e09 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -77,7 +77,6 @@ class cmTarget
{
public:
cmTarget();
- static const char* GetTargetTypeName(cmState::TargetType targetType);
enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD };
/**