[Cmake-commits] CMake branch, next, updated. v2.8.8-3145-gfbfed81

Peter Kuemmel syntheticpp at gmx.net
Wed Jun 13 13:21:57 EDT 2012


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  fbfed8156e43f5897a08b2b3a3fb6fdffb9e9dca (commit)
       via  ab8a2a57f2a4f746a42c4b7a1d52f93c15216b68 (commit)
      from  eecc5ec83eb49288c98605b0b0b64d9d2fbade0b (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=fbfed8156e43f5897a08b2b3a3fb6fdffb9e9dca
commit fbfed8156e43f5897a08b2b3a3fb6fdffb9e9dca
Merge: eecc5ec ab8a2a5
Author:     Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Wed Jun 13 13:21:56 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jun 13 13:21:56 2012 -0400

    Merge topic 'ninja-cldeps' into next
    
    ab8a2a5 Ninja: onyl use pre processor for rc file parsing


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab8a2a57f2a4f746a42c4b7a1d52f93c15216b68
commit ab8a2a57f2a4f746a42c4b7a1d52f93c15216b68
Author:     Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Wed Jun 13 19:20:01 2012 +0200
Commit:     Peter Kuemmel <syntheticpp at gmx.net>
CommitDate: Wed Jun 13 19:20:01 2012 +0200

    Ninja: onyl use pre processor for rc file parsing

diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx
index 542fb90..193a2e0 100644
--- a/Source/cmcldeps.cxx
+++ b/Source/cmcldeps.cxx
@@ -604,7 +604,8 @@ bool contains(const std::string& str, const std::string& what) {
   return str.find(what) != std::string::npos;
 }
 
-std::string replace(const std::string& str, const std::string& what, const std::string& replacement) {
+std::string replace(const std::string& str, const std::string& what,
+                    const std::string& replacement) {
   size_t pos = str.find(what);
   if (pos == std::string::npos)
     return str;
@@ -614,12 +615,12 @@ std::string replace(const std::string& str, const std::string& what, const std::
 
 
 
-static int process(bool ignoreErrors,
-                    const string& srcfile,
+static int process( const string& srcfile,
                     const string& dfile,
                     const string& objfile,
                     const string& prefix,
-                    const string& cmd) {
+                    const string& cmd,
+                    bool quiet = false) {
 
   SubprocessSet subprocs;
   Subprocess* subproc = subprocs.Add(cmd);
@@ -652,8 +653,7 @@ static int process(bool ignoreErrors,
        }
     } else {
       if (!isFirstLine || !startsWith(line, srcfile)) {
-        if (!ignoreErrors) {
-          // suppress errors when cl is fed with a rc file
+        if (!quiet) {
           fprintf(stdout, "%s\n", line.c_str());
         }
       } else {
@@ -663,10 +663,6 @@ static int process(bool ignoreErrors,
   }
 
   if (!success) {
-    if (ignoreErrors) {
-      //printf("\n-- RC file %i dependencies in %s\n\n", includes.size(), dfile.c_str());
-      outputDepFile(dfile, objfile, includes);
-    }
     return exit_code;
   }
 
@@ -699,19 +695,19 @@ int main() {
 #endif
 
   if (lang != "RC") {
-    return process(false, srcfile, dfile, objfile, prefix, binpath + " /showIncludes " + rest);
+    return process(srcfile, dfile, objfile, prefix,
+                   binpath + " /showIncludes " + rest);
   } else {
     // "misuse" cl.exe to get headers from .rc files
     // rc: /fo  x\CMakeFiles\x.dir\x.rc.res              src\x\x.rc
     // cl: /out:x\CMakeFiles\x.dir\x.rc.res.dep.obj  /Tc src\x\x.rc
 
-    cl = "\"" + cl + "\" /showIncludes ";
-    string clRest = rest;
-    clRest = replace(clRest, "/fo" + objfile, "/out:" + objfile + ".dep.obj /Tc ");
+    cl = "\"" + cl + "\" /P /DRC_INVOKED /showIncludes " +
+         replace(rest, "/fo" + objfile, "/out:" + objfile + ".dep.obj /Tc ");
 
     int ret;
-    ret = process(true,  srcfile, dfile, objfile, prefix, cl + clRest);
-    ret = process(false, srcfile, ""   , objfile, prefix, binpath + " " + rest);
+    ret = process(srcfile, dfile, objfile, prefix, cl, true);
+    ret = process(srcfile, ""   , objfile, prefix, binpath + " " + rest);
     return ret;
   }
 

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

Summary of changes:
 Source/cmcldeps.cxx |   28 ++++++++++++----------------
 1 files changed, 12 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list