summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-04-22 15:10:19 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-04-22 15:10:19 (GMT)
commit7f5446b2ef54e82c10a45229b2cf980a7e731bf8 (patch)
tree8d9563b50ae274394f0ac5578f5297f0c9bdebcb /Source/cmMakefileTargetGenerator.cxx
parent7e5921eff4761c0a122e1ac4488c41345fc2ec38 (diff)
downloadCMake-7f5446b2ef54e82c10a45229b2cf980a7e731bf8.zip
CMake-7f5446b2ef54e82c10a45229b2cf980a7e731bf8.tar.gz
CMake-7f5446b2ef54e82c10a45229b2cf980a7e731bf8.tar.bz2
BUG: fix for bug 6834 RC should not get all COMPILE_FLAGS from a target and should work the same way as it does in the vs ide
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx29
1 files changed, 27 insertions, 2 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 28a6105..6cb5fd0 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -491,8 +491,33 @@ cmMakefileTargetGenerator
// Add target-specific flags.
if(this->Target->GetProperty("COMPILE_FLAGS"))
{
- this->LocalGenerator->AppendFlags
- (flags, this->Target->GetProperty("COMPILE_FLAGS"));
+ std::string langIncludeExpr = "CMAKE_";
+ langIncludeExpr += lang;
+ langIncludeExpr += "_FLAG_REGEX";
+ const char* regex = this->Makefile->
+ GetDefinition(langIncludeExpr.c_str());
+ if(regex)
+ {
+ cmsys::RegularExpression r(regex);
+ std::vector<std::string> args;
+ cmSystemTools::ParseWindowsCommandLine(
+ this->Target->GetProperty("COMPILE_FLAGS"),
+ args);
+ for(std::vector<std::string>::iterator i = args.begin();
+ i != args.end(); ++i)
+ {
+ if(r.find(i->c_str()))
+ {
+ this->LocalGenerator->AppendFlags
+ (flags, i->c_str());
+ }
+ }
+ }
+ else
+ {
+ this->LocalGenerator->AppendFlags
+ (flags, this->Target->GetProperty("COMPILE_FLAGS"));
+ }
}
// Add flags from source file properties.