From d2d7ae0738b2bb59ee5a701794e73802795b2ce6 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Mon, 21 Aug 2017 14:41:17 +0200 Subject: Ninja: Implement support for GNUToMS Port the implementation from `cmMakefileTargetGenerator::GetLinkRule`. Fixes: #13870 --- Source/cmNinjaNormalTargetGenerator.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index f029a3f..ddac20e 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -485,7 +485,16 @@ std::vector cmNinjaNormalTargetGenerator::ComputeLinkCmd() this->TargetLinkLanguage, this->GetConfigName()); const char* linkCmd = mf->GetDefinition(linkCmdVar); if (linkCmd) { - cmSystemTools::ExpandListArgument(linkCmd, linkCmds); + std::string linkCmdStr = linkCmd; + if (this->GetGeneratorTarget()->HasImplibGNUtoMS()) { + std::string ruleVar = "CMAKE_"; + ruleVar += this->GeneratorTarget->GetLinkerLanguage(this->ConfigName); + ruleVar += "_GNUtoMS_RULE"; + if (const char* rule = this->Makefile->GetDefinition(ruleVar)) { + linkCmdStr += rule; + } + } + cmSystemTools::ExpandListArgument(linkCmdStr, linkCmds); if (this->GetGeneratorTarget()->GetPropertyAsBool("LINK_WHAT_YOU_USE")) { std::string cmakeCommand = this->GetLocalGenerator()->ConvertToOutputFormat( -- cgit v0.12