From 3d0e95f64c996d3d54b387f7688f988dd843ac6a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 9 Oct 2016 10:47:44 +0200 Subject: cmLocalGenerator: Extract definition retrieval out of loop --- Source/cmLocalGenerator.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2284cf9..025b82a 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1176,12 +1176,13 @@ void cmLocalGenerator::GetTargetFlags( !(this->Makefile->IsOn("CYGWIN") || this->Makefile->IsOn("MINGW"))) { std::vector sources; target->GetSourceFiles(sources, buildType); + std::string defFlag = + this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG"); for (std::vector::const_iterator i = sources.begin(); i != sources.end(); ++i) { cmSourceFile* sf = *i; if (sf->GetExtension() == "def") { - linkFlags += - this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG"); + linkFlags += defFlag; linkFlags += this->ConvertToOutputFormat( cmSystemTools::CollapseFullPath(sf->GetFullPath()), SHELL); linkFlags += " "; -- cgit v0.12