summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-14 17:42:27 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-14 18:50:39 (GMT)
commit9d11bd50661a1fb0a079c7c17120273f21ea9a8c (patch)
tree3e02a1c74e8594c0cbe97b5ad71035a84618adb9 /Source/cmMakefile.cxx
parentd97513d842c51e4fb996d42e1f04a9c291e3d5bf (diff)
downloadCMake-9d11bd50661a1fb0a079c7c17120273f21ea9a8c.zip
CMake-9d11bd50661a1fb0a079c7c17120273f21ea9a8c.tar.gz
CMake-9d11bd50661a1fb0a079c7c17120273f21ea9a8c.tar.bz2
Avoid requiring default cmTarget constructor for map indexing
The `std::map<>` index operator requires a default constructor on the value type. Avoid requiring a default constructor on `cmTarget` just for this purpose.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e5a5e6e..eb39afa 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -979,8 +979,9 @@ void cmMakefile::AddCustomCommandOldStyle(
// then add the source to the target to make sure the rule is
// included.
if (sf && !sf->GetPropertyAsBool("__CMAKE_RULE")) {
- if (this->Targets.find(target) != this->Targets.end()) {
- this->Targets[target].AddSource(sf->GetFullPath());
+ cmTargets::iterator ti = this->Targets.find(target);
+ if (ti != this->Targets.end()) {
+ ti->second.AddSource(sf->GetFullPath());
} else {
cmSystemTools::Error("Attempt to add a custom rule to a target "
"that does not exist yet for target ",