summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmGeneratorTarget.cxx11
-rw-r--r--Source/cmGeneratorTarget.h8
2 files changed, 18 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 011fc6cc54..90cca1be75 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -692,3 +692,14 @@ void cmGeneratorTarget::GenerateTargetManifest(const char* config) const
gg->AddToManifest(config? config:"", f);
}
}
+
+bool cmStrictTargetComparison::operator()(cmTarget *t1, cmTarget *t2) const
+{
+ int nameResult = strcmp(t1->GetName(), t2->GetName());
+ if (nameResult == 0)
+ {
+ return strcmp(t1->GetMakefile()->GetStartDirectory(),
+ t2->GetMakefile()->GetStartDirectory()) < 0;
+ }
+ return nameResult < 0;
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 69d1bb2f16..d2b65b28ec 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -100,6 +100,12 @@ private:
void operator=(cmGeneratorTarget const&);
};
-typedef std::map<cmTarget*, cmGeneratorTarget*> cmGeneratorTargetsType;
+struct cmStrictTargetComparison {
+ bool operator()(cmTarget *t1, cmTarget *t2) const;
+};
+
+typedef std::map<cmTarget*,
+ cmGeneratorTarget*,
+ cmStrictTargetComparison> cmGeneratorTargetsType;
#endif