cmNinjaTargetGenerator: Add Fortran flag generation

Make ComputeFlagsForObject consistent with the Makefile generator
in regard to Fortran flags.
This commit is contained in:
Brad King 2015-07-09 09:54:56 -04:00
parent 058074d499
commit 6a56740e27
1 changed files with 12 additions and 7 deletions

View File

@ -110,13 +110,6 @@ std::string
cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source, cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source,
const std::string& language) const std::string& language)
{ {
// TODO: Fortran support.
// // Fortran-specific flags computed for this target.
// if(*l == "Fortran")
// {
// this->AddFortranFlags(flags);
// }
bool hasLangCached = this->LanguageFlags.count(language) != 0; bool hasLangCached = this->LanguageFlags.count(language) != 0;
std::string& languageFlags = this->LanguageFlags[language]; std::string& languageFlags = this->LanguageFlags[language];
if(!hasLangCached) if(!hasLangCached)
@ -128,6 +121,12 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source,
language, language,
this->GetConfigName()); this->GetConfigName());
// Fortran-specific flags computed for this target.
if(language == "Fortran")
{
this->AddFortranFlags(languageFlags);
}
// Add shared-library flags if needed. // Add shared-library flags if needed.
this->LocalGenerator->AddCMP0018Flags(languageFlags, this->Target, this->LocalGenerator->AddCMP0018Flags(languageFlags, this->Target,
language, language,
@ -166,6 +165,12 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source,
std::string flags = languageFlags; std::string flags = languageFlags;
// Add Fortran format flags.
if(language == "Fortran")
{
this->AppendFortranFormatFlags(flags, *source);
}
// Add source file specific flags. // Add source file specific flags.
this->LocalGenerator->AppendFlags(flags, this->LocalGenerator->AppendFlags(flags,
source->GetProperty("COMPILE_FLAGS")); source->GetProperty("COMPILE_FLAGS"));