diff options
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index e780219..13c1b64 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1391,3 +1391,35 @@ cmMakefileTargetGenerator MultipleOutputPairsType::value_type p(depender, dependee); this->MultipleOutputPairs.insert(p); } + +//---------------------------------------------------------------------------- +void +cmMakefileTargetGenerator +::CreateLinkScript(const char* name, + std::vector<std::string> const& link_commands, + std::vector<std::string>& makefile_commands) +{ + // Create the link script file. + std::string linkScriptName = this->TargetBuildDirectoryFull; + linkScriptName += "/"; + linkScriptName += name; + cmGeneratedFileStream linkScriptStream(linkScriptName.c_str()); + for(std::vector<std::string>::const_iterator cmd = link_commands.begin(); + cmd != link_commands.end(); ++cmd) + { + // Do not write out empty commands or commands beginning in the + // shell no-op ":". + if(!cmd->empty() && (*cmd)[0] != ':') + { + linkScriptStream << *cmd << "\n"; + } + } + + // Create the makefile command to invoke the link script. + std::string link_command = "$(CMAKE_COMMAND) -E cmake_link_script "; + link_command += this->Convert(linkScriptName.c_str(), + cmLocalGenerator::START_OUTPUT, + cmLocalGenerator::SHELL); + link_command += " --verbose=$(VERBOSE)"; + makefile_commands.push_back(link_command); +} |