|
|
@@ -332,21 +332,25 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
|
|
|
this->Makefile->GetSafeDefinition(compiler.c_str()) << "\n";
|
|
|
}
|
|
|
|
|
|
+ std::string targetFlags;
|
|
|
for(std::set<cmStdString>::const_iterator l = languages.begin();
|
|
|
l != languages.end(); ++l)
|
|
|
{
|
|
|
*this->FlagFileStream << *l << "_FLAGS = " << this->GetFlags(*l) << "\n\n";
|
|
|
*this->FlagFileStream << *l << "_DEFINES = " << this->GetDefines(*l) <<
|
|
|
"\n\n";
|
|
|
+ std::string targetLangFlags;
|
|
|
+ this->LocalGenerator->GetCompileOptions(targetLangFlags, this->Target,
|
|
|
+ this->LocalGenerator->ConfigurationName.c_str());
|
|
|
+ if (!targetFlags.empty() && targetFlags != targetLangFlags)
|
|
|
+ {
|
|
|
+ targetFlags += " " + targetLangFlags;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- // Add target-specific flags.
|
|
|
- if(this->Target->GetProperty("COMPILE_FLAGS"))
|
|
|
+ if (!targetFlags.empty())
|
|
|
{
|
|
|
- std::string flags;
|
|
|
- this->LocalGenerator->AppendFlags
|
|
|
- (flags, this->Target->GetProperty("COMPILE_FLAGS"));
|
|
|
- *this->FlagFileStream << "# TARGET_FLAGS = " << flags << "\n\n";
|
|
|
+ *this->FlagFileStream << "# TARGET_FLAGS = " << targetFlags << "\n\n";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -532,8 +536,13 @@ cmMakefileTargetGenerator
|
|
|
langFlags += "_FLAGS)";
|
|
|
this->LocalGenerator->AppendFlags(flags, langFlags.c_str());
|
|
|
|
|
|
- // Add target-specific flags.
|
|
|
- if(this->Target->GetProperty("COMPILE_FLAGS"))
|
|
|
+ std::string configUpper =
|
|
|
+ cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName);
|
|
|
+
|
|
|
+ std::string targetFlags;
|
|
|
+ this->LocalGenerator->GetCompileOptions(targetFlags, this->Target,
|
|
|
+ configUpper.c_str());
|
|
|
+ if (!targetFlags.empty())
|
|
|
{
|
|
|
std::string langIncludeExpr = "CMAKE_";
|
|
|
langIncludeExpr += lang;
|
|
|
@@ -545,7 +554,7 @@ cmMakefileTargetGenerator
|
|
|
cmsys::RegularExpression r(regex);
|
|
|
std::vector<std::string> args;
|
|
|
cmSystemTools::ParseWindowsCommandLine(
|
|
|
- this->Target->GetProperty("COMPILE_FLAGS"),
|
|
|
+ targetFlags.c_str(),
|
|
|
args);
|
|
|
for(std::vector<std::string>::iterator i = args.begin();
|
|
|
i != args.end(); ++i)
|
|
|
@@ -559,8 +568,7 @@ cmMakefileTargetGenerator
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- this->LocalGenerator->AppendFlags
|
|
|
- (flags, this->Target->GetProperty("COMPILE_FLAGS"));
|
|
|
+ this->LocalGenerator->AppendFlags(flags, targetFlags.c_str());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -594,8 +602,6 @@ cmMakefileTargetGenerator
|
|
|
<< compile_defs << "\n"
|
|
|
<< "\n";
|
|
|
}
|
|
|
- std::string configUpper =
|
|
|
- cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName);
|
|
|
std::string defPropName = "COMPILE_DEFINITIONS_";
|
|
|
defPropName += configUpper;
|
|
|
if(const char* config_compile_defs =
|