From de7083f3c0bdc9c0af0d35c44afde86aab6d6622 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 14 Nov 2016 11:39:23 -0500 Subject: Ninja: Document why ComputeLinkCmd is structured the way it is. --- Source/cmNinjaNormalTargetGenerator.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index a23e0ad..3598914 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -332,6 +332,9 @@ std::vector cmNinjaNormalTargetGenerator::ComputeLinkCmd() std::vector linkCmds; cmMakefile* mf = this->GetMakefile(); { + // If we have a rule variable prefer it. In the case of static libraries + // this occurs when things like IPO is enabled, and we need to use the + // CMAKE__CREATE_STATIC_LIBRARY_IPO define instead. std::string linkCmdVar = this->GetGeneratorTarget()->GetCreateRuleVariable( this->TargetLinkLanguage, this->GetConfigName()); const char* linkCmd = mf->GetDefinition(linkCmdVar); -- cgit v0.12