diff options
author | Brad King <brad.king@kitware.com> | 2016-09-14 17:42:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-14 18:50:39 (GMT) |
commit | 9d11bd50661a1fb0a079c7c17120273f21ea9a8c (patch) | |
tree | 3e02a1c74e8594c0cbe97b5ad71035a84618adb9 /Source/cmMakefile.cxx | |
parent | d97513d842c51e4fb996d42e1f04a9c291e3d5bf (diff) | |
download | CMake-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.cxx | 5 |
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 ", |