summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-04-01 13:13:16 (GMT)
committerBrad King <brad.king@kitware.com>2016-04-01 19:44:16 (GMT)
commitbc30f8b5e66cb9c15fd224f5e51454c0bc66c67e (patch)
tree429a2ad4ed3867eb73043df1573f8724c54c4f4f /Source/cmMakefile.h
parent64130a7e793483e24c1d68bdd234f81d5edb2d51 (diff)
downloadCMake-bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.zip
CMake-bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.tar.gz
CMake-bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.tar.bz2
Fix lookup of an ALIAS target outside aliased target's directory (#16044)
Refactoring in commit v3.5.0-rc1~272^2~11 (cmTarget: Implement ALIAS in terms of name mapping, 2015-10-25) accidentally introduced logic that assumes ALIAS targets always reference targets in their own directory. Fix this and add a test case. The configure-step fix is that `cmMakefile::FindTarget` should not consider aliases. The purpose of this method is just to look up targets local to a directory. Since ALIAS and normal targets share a namespace we know a locally defined target will never collide with an ALIAS target anyway. The method has 3 call sites, and this change is safe for all of them: * `cmInstallCommand::HandleTargetsMode`: Rejects aliases before the call. * `cmFLTKWrapUICommand::FinalPass`: Should never have considered aliases. * `cmMakefile::FindTargetToUse`: Falls back to a global lookup anyway. The generate-step fix is that `cmLocalGenerator::FindGeneratorTarget` should not consider aliases. This method is the generate-step equivalent to the above. The method has 2 call sites, and this change is safe for both of them: * `cmInstallTargetGenerator::Compute`: Never uses an alias target name. * `cmLocalGenerator::FindGeneratorTargetToUse`: Falls back to global lookup. Reported-by: Matteo Settenvini <matteo@member.fsf.org>
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r--Source/cmMakefile.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 362ea75..a69c705 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -388,8 +388,7 @@ public:
}
std::vector<cmTarget*> GetImportedTargets() const;
- cmTarget* FindTarget(const std::string& name,
- bool excludeAliases = false) const;
+ cmTarget* FindTarget(const std::string& name) const;
/** Find a target to use in place of the given name. The target
returned may be imported or built within the project. */