mirror of
https://github.com/reactos/CMake.git
synced 2025-02-26 06:55:34 +00:00
CMP0065: Put computed flags into LINK_FLAGS not LINK_LIBRARIES
These flags are redundant anyway in the NEW case of the policy, and could be merged with CMAKE_EXE_EXPORTS_${lang}_FLAG content for that case. That is deferred to the future, but now at least the similar code is located close to each other.
This commit is contained in:
parent
7f1cd3280c
commit
0f1fedbd6a
@ -1248,6 +1248,14 @@ void cmLocalGenerator::GetTargetFlags(
|
||||
linkFlags += this->Makefile->GetSafeDefinition(exportFlagVar);
|
||||
linkFlags += " ";
|
||||
}
|
||||
|
||||
std::string cmp0065Flags =
|
||||
this->GetLinkLibsCMP0065(linkLanguage, *target);
|
||||
if (!cmp0065Flags.empty()) {
|
||||
linkFlags += cmp0065Flags;
|
||||
linkFlags += " ";
|
||||
}
|
||||
|
||||
const char* targetLinkFlags = target->GetProperty("LINK_FLAGS");
|
||||
if (targetLinkFlags) {
|
||||
linkFlags += targetLinkFlags;
|
||||
@ -1430,7 +1438,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
|
||||
|
||||
std::string linkLanguage = cli.GetLinkLanguage();
|
||||
|
||||
std::string linkLibs = this->GetLinkLibsCMP0065(linkLanguage, tgt);
|
||||
std::string linkLibs;
|
||||
|
||||
std::string libPathFlag =
|
||||
this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG");
|
||||
|
@ -192,6 +192,11 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
|
||||
this->LocalGenerator->AppendFlags(
|
||||
linkFlags, this->Makefile->GetDefinition(export_flag_var));
|
||||
}
|
||||
|
||||
this->LocalGenerator->AppendFlags(linkFlags,
|
||||
this->LocalGenerator->GetLinkLibsCMP0065(
|
||||
linkLanguage, *this->GeneratorTarget));
|
||||
|
||||
if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
|
||||
this->LocalGenerator->AppendFlags(linkFlags, " -Wl,--no-as-needed");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user