Merge topic 'ninja-issue-13069'

d807aab Ninja: apply CMAKE_<LANG>_FLAGS_<TYPE> to executable targets (#13069)
This commit is contained in:
David Cole 2012-05-17 14:59:52 -04:00 committed by CMake Topic Stage
commit 78733119cb
2 changed files with 7 additions and 9 deletions

View File

@ -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 += " ";

View File

@ -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();