[Cmake-commits] CMake branch, next, updated. v3.1.0-1867-g261a06e

Stephen Kelly steveire at gmail.com
Tue Jan 13 17:17:59 EST 2015


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  261a06e8ed0fd47ceb7d38cd3f64061a6e5ee876 (commit)
       via  c20ec207885ed72d331a101ae7e7a37767268a87 (commit)
       via  28dae13cad1aab10fb7c9f14b1b417038dd0c144 (commit)
      from  a0b93d7dd06b94731be61a639bcedaecf5fe7192 (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=261a06e8ed0fd47ceb7d38cd3f64061a6e5ee876
commit 261a06e8ed0fd47ceb7d38cd3f64061a6e5ee876
Merge: a0b93d7 c20ec20
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jan 13 17:17:59 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jan 13 17:17:59 2015 -0500

    Merge topic 'Apple-compiler-selection' into next
    
    c20ec207 Apple: Resolve compiler in /usr/bin to that reported by Xcode
    28dae13c Project: Extract xcrun invocation into a macro.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c20ec207885ed72d331a101ae7e7a37767268a87
commit c20ec207885ed72d331a101ae7e7a37767268a87
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jan 3 17:36:34 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jan 13 23:12:57 2015 +0100

    Apple: Resolve compiler in /usr/bin to that reported by Xcode
    
    The compiler in the PATH on mac is a stub for a different delegate
    depending on the environment.  Rather than requiring xcode-select to
    change the used Xcode globally, users should be able to choose the
    compiler per-session.  That is possible with the DEVELOPER_DIR
    environment variable.
    
    However, the environment can change between running CMake and invoking
    the build.  In such cases, CMake prefers to record the relevant paths
    from the environment and use them when invoking the build.  That is not
    currently done for the compilers on APPLE, so the compiler used is not
    the one reported when running cmake:
    
     $ DEVELOPER_DIR=/Applications/Xcode2.app/Contents/Developer/ cc --version
     Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
     Target: x86_64-apple-darwin13.4.0
     Thread model: posix
    
     $ DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/ cc --version
     Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
     Target: x86_64-apple-darwin13.4.0
     Thread model: posix
    
    Update that now by querying Xcode for the correct compiler path if
    the compiler located by ordinary means is located in /usr/bin.  It is
    expected that compilers installed manually or through a package manager
    will not be found there but will be in /usr/local instead.

diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 7cc0ee0..e3b4434 100644
--- a/Modules/CMakeDetermineCompiler.cmake
+++ b/Modules/CMakeDetermineCompiler.cmake
@@ -71,7 +71,7 @@ macro(_cmake_find_compiler lang)
   unset(_languages)
 
   # Look for a make tool provided by Xcode
-  if(CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" AND CMAKE_HOST_APPLE)
+  if(CMAKE_HOST_APPLE)
     macro(_query_xrun compiler_name result_var_keyword result_var)
       if(NOT result_var_keyword STREQUAL "RESULT_VAR")
         message(FATAL_ERROR "Bad arguments to macro")
@@ -81,13 +81,21 @@ macro(_cmake_find_compiler lang)
         ERROR_VARIABLE _xcrun_err)
       set(${result_var} ${_xcrun_out})
     endmacro()
-    foreach(comp ${CMAKE_${lang}_COMPILER_LIST})
-      _query_xrun(${comp} RESULT_VAR _xcrun_result)
-      if(_xcrun_result)
-        set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_result}")
-        break()
-      endif()
-    endforeach()
+
+    set(xcrun_result)
+    if (CMAKE_${lang}_COMPILER MATCHES "^/usr/bin/(.+)$")
+      _query_xrun(${CMAKE_MATCH_1} RESULT_VAR xcrun_result)
+    elseif (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND")
+      foreach(comp ${CMAKE_${lang}_COMPILER_LIST})
+        _query_xrun(${comp} RESULT_VAR xcrun_result)
+        if(xcrun_result)
+          break()
+        endif()
+      endforeach()
+    endif()
+    if (xcrun_result)
+      set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${xcrun_result}")
+    endif()
   endif()
 endmacro()
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28dae13cad1aab10fb7c9f14b1b417038dd0c144
commit 28dae13cad1aab10fb7c9f14b1b417038dd0c144
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jan 13 23:10:46 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jan 13 23:10:46 2015 +0100

    Project: Extract xcrun invocation into a macro.

diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 0ab3af6..7cc0ee0 100644
--- a/Modules/CMakeDetermineCompiler.cmake
+++ b/Modules/CMakeDetermineCompiler.cmake
@@ -72,12 +72,19 @@ macro(_cmake_find_compiler lang)
 
   # Look for a make tool provided by Xcode
   if(CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" AND CMAKE_HOST_APPLE)
-    foreach(comp ${CMAKE_${lang}_COMPILER_LIST})
-      execute_process(COMMAND xcrun --find ${comp}
+    macro(_query_xrun compiler_name result_var_keyword result_var)
+      if(NOT result_var_keyword STREQUAL "RESULT_VAR")
+        message(FATAL_ERROR "Bad arguments to macro")
+      endif()
+      execute_process(COMMAND xcrun --find ${compiler_name}
         OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE
         ERROR_VARIABLE _xcrun_err)
-      if(_xcrun_out)
-        set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_out}")
+      set(${result_var} ${_xcrun_out})
+    endmacro()
+    foreach(comp ${CMAKE_${lang}_COMPILER_LIST})
+      _query_xrun(${comp} RESULT_VAR _xcrun_result)
+      if(_xcrun_result)
+        set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_result}")
         break()
       endif()
     endforeach()

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list