summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx35
1 files changed, 13 insertions, 22 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 14b5a92..2b531e2 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -56,7 +56,6 @@ struct ModuleDefinitionFileTag {};
struct AppManifestTag{};
struct CertificatesTag{};
-#if !defined(_MSC_VER) || _MSC_VER >= 1310
template<typename Tag, typename OtherTag>
struct IsSameTag
{
@@ -72,25 +71,6 @@ struct IsSameTag<Tag, Tag>
Result = true
};
};
-#else
-struct IsSameTagBase
-{
- typedef char (&no_type)[1];
- typedef char (&yes_type)[2];
- template<typename T> struct Check;
- template<typename T> static yes_type check(Check<T>*, Check<T>*);
- static no_type check(...);
-};
-template<typename Tag1, typename Tag2>
-struct IsSameTag: public IsSameTagBase
-{
- enum {
- Result = (sizeof(check(static_cast< Check<Tag1>* >(0),
- static_cast< Check<Tag2>* >(0))) ==
- sizeof(yes_type))
- };
-};
-#endif
template<bool>
struct DoAccept
@@ -646,6 +626,17 @@ cmTargetTraceDependencies
si != sources.end(); ++si)
{
cmSourceFile* sf = *si;
+ const std::set<cmTarget const*> tgts =
+ this->GlobalGenerator->GetFilenameTargetDepends(sf);
+ if (tgts.find(this->Target) != tgts.end())
+ {
+ cmOStringStream e;
+ e << "Evaluation output file\n \"" << sf->GetFullPath()
+ << "\"\ndepends on the sources of a target it is used in. This "
+ "is a dependency loop and is not allowed.";
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ return;
+ }
if(emitted.insert(sf).second && this->SourcesQueued.insert(sf).second)
{
this->SourceQueue.push(sf);
@@ -772,8 +763,8 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
std::string tLocation = t->GetLocationForBuild();
tLocation = cmSystemTools::GetFilenamePath(tLocation);
std::string depLocation = cmSystemTools::GetFilenamePath(dep);
- depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str());
- tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str());
+ depLocation = cmSystemTools::CollapseFullPath(depLocation);
+ tLocation = cmSystemTools::CollapseFullPath(tLocation);
if(depLocation == tLocation)
{
this->Target->AddUtility(util);