[Cmake-commits] CMake branch, next, updated. v3.0.0-4425-gd0c6546

Stephen Kelly steveire at gmail.com
Tue Jul 22 10:57:15 EDT 2014


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  d0c654609abd352e67a7aacb398d2c6b57e88bd3 (commit)
       via  a12e4e782c9c8d290071a3fb8f8abcf5cba24afe (commit)
      from  cbd554fbd01117866dd11eaac3b0d014d8f4552d (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=d0c654609abd352e67a7aacb398d2c6b57e88bd3
commit d0c654609abd352e67a7aacb398d2c6b57e88bd3
Merge: cbd554f a12e4e7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jul 22 10:57:14 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jul 22 10:57:14 2014 -0400

    Merge topic 'fix-broken-re-cmake' into next
    
    a12e4e78 cmake: Avoid overwriting compiler name if specified repeatedly.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a12e4e782c9c8d290071a3fb8f8abcf5cba24afe
commit a12e4e782c9c8d290071a3fb8f8abcf5cba24afe
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 21 18:05:53 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jul 22 16:44:12 2014 +0200

    cmake: Avoid overwriting compiler name if specified repeatedly.
    
    If CMake is invoked repeatedly on the command line with the
    compiler of a language specified by name, don't replace the
    cached value with the un-resolved name if the resolved name is
    the same as the path in the cache.

diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index a051c87..3e4ae17 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -355,6 +355,36 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
             }
           }
 
+        cmsys::RegularExpression compilerRex("^CMAKE_[a-zA-Z]+_COMPILER$");
+        if (compilerRex.find(var))
+          {
+          std::string newVal = cmSystemTools::FindProgram(value.c_str());
+          const char* existing =
+                          this->CacheManager->GetCacheValue(var.c_str());
+          if (existing && existing == newVal)
+            {
+            // Repeated invocation of cmake with arguments specifying a
+            // compiler, such as -DCMAKE_CXX_COMPILER=clang++, should not
+            // re-populate the cache with the un-resolved name.  On the
+            // first run of cmake, the CMakeDetermineCXXCompiler.cmake logic
+            // is executed and the result is resolved to a full path and
+            // cached,  On subsequent runs of cmake, we wish to avoid
+            // re-executing the CMakeDetermineCXXCompiler.cmake logic.
+            // The cmGlobalGenerator::ResolveLanguageCompiler method is
+            // responsible for ensuring that the cache is deleted if the
+            // value in the cache is changed.
+            // A scripting environment can invoke cmake on the command line
+            // with arguments specifying the compiler in a way which is
+            // intended to give reproducible results.  Ignore the value
+            // specified on the command line if it results in the same
+            // value as is already in the cache.  Otherwise,
+            // cmMakefile::AddCacheDefinition would use CollapseFullPath on
+            // the entry, incorrectly resolving 'clang++' to
+            // '<CMAKE_BUILD_DIR>/clang++', which is unlikely to exist.
+            continue;
+            }
+          }
+
         this->CacheManager->AddCacheEntry(var, value.c_str(),
           "No help, variable specified on the command line.", type);
 

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

Summary of changes:
 Source/cmake.cxx |   30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list