[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5195-g753fce7

Nils Gladitz nilsgladitz at gmail.com
Sun Nov 17 05:07:42 EST 2013


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  753fce7909711082ace4cc2054c9a3dcb2ee4510 (commit)
       via  9c57bd5deaa425b6daa6a0f718c01e501faab546 (commit)
      from  796baf9dfb3e2d243e2dbd029a90a1227f4bce05 (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=753fce7909711082ace4cc2054c9a3dcb2ee4510
commit 753fce7909711082ace4cc2054c9a3dcb2ee4510
Merge: 796baf9 9c57bd5
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Sun Nov 17 05:07:40 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Nov 17 05:07:40 2013 -0500

    Merge topic 'fix-remove-forbidden-flags' into next
    
    9c57bd5 MakefileGenerator: only remove flags that match as a whole


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c57bd5deaa425b6daa6a0f718c01e501faab546
commit 9c57bd5deaa425b6daa6a0f718c01e501faab546
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Fri Nov 15 21:41:11 2013 +0100
Commit:     Nils Gladitz <nilsgladitz at gmail.com>
CommitDate: Fri Nov 15 21:41:11 2013 +0100

    MakefileGenerator: only remove flags that match as a whole
    
    On the Mac this was incorrectly removing -w from -Wno-write-strings

diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 6770e10..2fcad79 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -27,6 +27,7 @@
 #include "cmMakefileLibraryTargetGenerator.h"
 #include "cmMakefileUtilityTargetGenerator.h"
 
+#include <ctype.h>
 
 cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target)
   : OSXBundleGenerator(0)
@@ -1694,10 +1695,42 @@ void cmMakefileTargetGenerator::RemoveForbiddenFlags(const char* flagVar,
     this->Makefile->GetSafeDefinition(removeFlags.c_str());
   std::vector<std::string> removeList;
   cmSystemTools::ExpandListArgument(removeflags, removeList);
+
   for(std::vector<std::string>::iterator i = removeList.begin();
       i != removeList.end(); ++i)
     {
-    cmSystemTools::ReplaceString(linkFlags, i->c_str(), "");
+    std::string tmp;
+    std::string::size_type lastPosition = 0;
+
+    for(;;)
+      {
+      std::string::size_type position = linkFlags.find(*i, lastPosition);
+
+      if(position == std::string::npos)
+        {
+        tmp += linkFlags.substr(lastPosition);
+        break;
+        }
+      else
+        {
+        std::string::size_type prefixLength = position - lastPosition;
+        tmp += linkFlags.substr(lastPosition, prefixLength);
+        lastPosition = position + i->length();
+
+        bool validFlagStart = position == 0 ||
+          isspace(linkFlags[position - 1]);
+
+        bool validFlagEnd = lastPosition == linkFlags.size() ||
+          isspace(linkFlags[lastPosition]);
+
+        if(!validFlagStart || !validFlagEnd)
+          {
+          tmp += *i;
+          }
+        }
+      }
+
+    linkFlags = tmp;
     }
 }
 

-----------------------------------------------------------------------

Summary of changes:
 Source/cmMakefileTargetGenerator.cxx |   35 +++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list