Commit d48f69d0 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

cmLocalGenerator: Move flag determination up in the function

This content is independent of any targets.
parent ff8e321c
Pipeline #30057 passed with stage
......@@ -1419,6 +1419,15 @@ void cmLocalGenerator::OutputLinkLibraries(
std::string libPathTerminator =
this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR");
// Add standard libraries for this language.
std::string standardLibsVar = "CMAKE_";
standardLibsVar += cli.GetLinkLanguage();
standardLibsVar += "_STANDARD_LIBRARIES";
std::string stdLibString;
if (const char* stdLibs = this->Makefile->GetDefinition(standardLibsVar)) {
stdLibString = stdLibs;
}
// Append the framework search path flags.
std::string fwSearchFlagVar = "CMAKE_";
fwSearchFlagVar += linkLanguage;
......@@ -1502,14 +1511,6 @@ void cmLocalGenerator::OutputLinkLibraries(
fout << " ";
}
// Add standard libraries for this language.
std::string standardLibsVar = "CMAKE_";
standardLibsVar += cli.GetLinkLanguage();
standardLibsVar += "_STANDARD_LIBRARIES";
std::string stdLibString;
if (const char* stdLibs = this->Makefile->GetDefinition(standardLibsVar)) {
stdLibString = stdLibs;
}
if (!stdLibString.empty()) {
fout << stdLibString << " ";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment