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