diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-10-08 10:21:36 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-10-10 18:38:54 (GMT) |
commit | 7ef834682547df5e0ccdcd503558dcbf1206a638 (patch) | |
tree | a90aabc08970996773103105c00a45859e197184 /Source/cmLocalGenerator.cxx | |
parent | 69295812065a5d07c07347add2fdcf8f36f993ba (diff) | |
download | CMake-7ef834682547df5e0ccdcd503558dcbf1206a638.zip CMake-7ef834682547df5e0ccdcd503558dcbf1206a638.tar.gz CMake-7ef834682547df5e0ccdcd503558dcbf1206a638.tar.bz2 |
cmLocalGenerator: Pass link library info to OutputLinkLibraries
Remove the cmGeneratorTarget from the interface.
This is simplification of the OutputLinkLibraries responsibilities so
that it can be broken apart into multiple methods.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c152a8b..ae4a0b2 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1155,6 +1155,7 @@ void cmLocalGenerator::GetTargetFlags( bool useWatcomQuote) { const std::string buildType = cmSystemTools::UpperCase(config); + cmComputeLinkInformation* pcli = target->GetLinkInformation(config); const char* libraryLinkVariable = "CMAKE_SHARED_LINKER_FLAGS"; // default to shared library @@ -1205,9 +1206,11 @@ void cmLocalGenerator::GetTargetFlags( linkFlags += " "; } } - this->OutputLinkLibraries(linkLineComputer, linkLibs, frameworkPath, - linkPath, *target, false, false, - useWatcomQuote); + if (pcli) { + this->OutputLinkLibraries(pcli, linkLineComputer, linkLibs, + frameworkPath, linkPath, false, false, + useWatcomQuote); + } } break; case cmState::EXECUTABLE: { linkFlags += this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS"); @@ -1226,9 +1229,11 @@ void cmLocalGenerator::GetTargetFlags( return; } this->AddLanguageFlags(flags, linkLanguage, buildType); - this->OutputLinkLibraries(linkLineComputer, linkLibs, frameworkPath, - linkPath, *target, false, false, - useWatcomQuote); + if (pcli) { + this->OutputLinkLibraries(pcli, linkLineComputer, linkLibs, + frameworkPath, linkPath, false, false, + useWatcomQuote); + } if (cmSystemTools::IsOn( this->Makefile->GetDefinition("BUILD_SHARED_LIBS"))) { std::string sFlagVar = std::string("CMAKE_SHARED_BUILD_") + @@ -1393,19 +1398,16 @@ std::string cmLocalGenerator::GetTargetFortranFlags( * to the name of the library. This will not link a library against itself. */ void cmLocalGenerator::OutputLinkLibraries( - cmLinkLineComputer* linkLineComputer, std::string& linkLibraries, - std::string& frameworkPath, std::string& linkPath, cmGeneratorTarget& tgt, - bool relink, bool forResponseFile, bool useWatcomQuote) + cmComputeLinkInformation* pcli, cmLinkLineComputer* linkLineComputer, + std::string& linkLibraries, std::string& frameworkPath, + std::string& linkPath, bool relink, bool forResponseFile, + bool useWatcomQuote) { OutputFormat shellFormat = (forResponseFile) ? RESPONSE : ((useWatcomQuote) ? WATCOMQUOTE : SHELL); bool escapeAllowMakeVars = !forResponseFile; std::ostringstream fout; - std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); - cmComputeLinkInformation* pcli = tgt.GetLinkInformation(config); - if (!pcli) { - return; - } + cmComputeLinkInformation& cli = *pcli; std::string linkLanguage = cli.GetLinkLanguage(); |