Commit e20c0071 authored by Brad King's avatar Brad King
Browse files

ENH: Order compilation flags from most general to most specific: language,...

ENH: Order compilation flags from most general to most specific: language, then target, then source.
parent 3fa4a95f
......@@ -321,8 +321,17 @@ cmMakefileTargetGenerator
relativeObj = cmSystemTools::ConvertToOutputPath(relativeObj.c_str());
}
// Write the build rule.
// Build the set of compiler flags.
std::string flags;
// Add language-specific flags.
std::string langFlags = "$(";
langFlags += lang;
langFlags += "_FLAGS)";
this->LocalGenerator->AppendFlags(flags, langFlags.c_str());
// Add target-specific flags.
if(this->Target->GetProperty("COMPILE_FLAGS"))
{
this->LocalGenerator->AppendFlags(flags, this->Target->GetProperty("COMPILE_FLAGS"));
......@@ -339,12 +348,6 @@ cmMakefileTargetGenerator
<< "\n";
}
// Add language-specific flags.
std::string langFlags = "$(";
langFlags += lang;
langFlags += "_FLAGS)";
this->LocalGenerator->AppendFlags(flags, langFlags.c_str());
// Get the output paths for source and object files.
std::string sourceFile = source.GetFullPath();
if(this->LocalGenerator->m_UseRelativePaths)
......
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