Merge topic 'ninja-issue-13069'
d807aab
Ninja: apply CMAKE_<LANG>_FLAGS_<TYPE> to executable targets (#13069)
This commit is contained in:
commit
78733119cb
|
@ -1548,13 +1548,10 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
|
||||||
target.GetName());
|
target.GetName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::string langVar = "CMAKE_";
|
this->AddLanguageFlags(flags, linkLanguage, buildType.c_str());
|
||||||
langVar += linkLanguage;
|
|
||||||
std::string flagsVar = langVar + "_FLAGS";
|
|
||||||
std::string sharedFlagsVar = "CMAKE_SHARED_LIBRARY_";
|
std::string sharedFlagsVar = "CMAKE_SHARED_LIBRARY_";
|
||||||
sharedFlagsVar += linkLanguage;
|
sharedFlagsVar += linkLanguage;
|
||||||
sharedFlagsVar += "_FLAGS";
|
sharedFlagsVar += "_FLAGS";
|
||||||
flags += this->Makefile->GetSafeDefinition(flagsVar.c_str());
|
|
||||||
flags += " ";
|
flags += " ";
|
||||||
flags += this->Makefile->GetSafeDefinition(sharedFlagsVar.c_str());
|
flags += this->Makefile->GetSafeDefinition(sharedFlagsVar.c_str());
|
||||||
flags += " ";
|
flags += " ";
|
||||||
|
|
|
@ -193,12 +193,13 @@ cmNinjaNormalTargetGenerator
|
||||||
vars.LinkFlags = "$LINK_FLAGS";
|
vars.LinkFlags = "$LINK_FLAGS";
|
||||||
|
|
||||||
std::string langFlags;
|
std::string langFlags;
|
||||||
this->GetLocalGenerator()->AddLanguageFlags(langFlags,
|
if (targetType != cmTarget::EXECUTABLE) {
|
||||||
this->TargetLinkLanguage,
|
this->GetLocalGenerator()->AddLanguageFlags(langFlags,
|
||||||
this->GetConfigName());
|
this->TargetLinkLanguage,
|
||||||
if (targetType != cmTarget::EXECUTABLE)
|
this->GetConfigName());
|
||||||
langFlags += " $ARCH_FLAGS";
|
langFlags += " $ARCH_FLAGS";
|
||||||
vars.LanguageCompileFlags = langFlags.c_str();
|
vars.LanguageCompileFlags = langFlags.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
// Rule for linking library.
|
// Rule for linking library.
|
||||||
std::vector<std::string> linkCmds = this->ComputeLinkCmd();
|
std::vector<std::string> linkCmds = this->ComputeLinkCmd();
|
||||||
|
|
Loading…
Reference in New Issue