This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via d2e906db5887a95a3e78e6742f4c0e4b662bc99b (commit) via a1c9c136c33bb9370e5d6c2780817590530c9fbc (commit) via 21f5fc12ee4ca043838264962fc7608a97b8f35f (commit) from e56136c280ddb00a0d64dd117547156f782c0314 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d2e906db5887a95a3e78e6742f4c0e4b662bc99b commit d2e906db5887a95a3e78e6742f4c0e4b662bc99b Merge: e56136c a1c9c13 Author: Peter Kuemmel <syntheti...@gmx.net> AuthorDate: Tue Sep 18 12:07:30 2012 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Tue Sep 18 12:07:30 2012 -0400 Merge topic 'ninja-rc-compile-flag' into next a1c9c13 Ninja: filter target specific compile flags with language specific regex 21f5fc1 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a1c9c136c33bb9370e5d6c2780817590530c9fbc commit a1c9c136c33bb9370e5d6c2780817590530c9fbc Author: Peter Kümmel <syntheti...@gmx.net> AuthorDate: Wed Aug 22 00:11:17 2012 +0200 Commit: Peter Kümmel <syntheti...@gmx.net> CommitDate: Tue Sep 18 18:02:10 2012 +0200 Ninja: filter target specific compile flags with language specific regex sync with Makefile code. Bug: 13486 Many thanks to Nils Gladitz diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 4cc23ca..385b4a0 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -167,11 +167,41 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, // Append old-style preprocessor definition flags. this->LocalGenerator->AppendFlags(flags, this->Makefile->GetDefineFlags()); - // Add target-specific and source-specific flags. - this->LocalGenerator->AppendFlags(flags, - this->Target->GetProperty("COMPILE_FLAGS")); - this->LocalGenerator->AppendFlags(flags, - source->GetProperty("COMPILE_FLAGS")); + // Add target-specific flags. + if(this->Target->GetProperty("COMPILE_FLAGS")) + { + std::string langIncludeExpr = "CMAKE_"; + langIncludeExpr += language; + 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 source file specific flags. + this->LocalGenerator->AppendFlags(flags, + source->GetProperty("COMPILE_FLAGS")); // TODO: Handle Apple frameworks. ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- Source/cmNinjaTargetGenerator.cxx | 40 ++++++++++++++++++++++++++++++++---- 2 files changed, 36 insertions(+), 6 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits