[Cmake-commits] CMake branch, next, updated. v3.1.0-1917-ge9ecfbc
Brad King
brad.king at kitware.com
Wed Jan 14 15:27:53 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 e9ecfbc0de78bda55e0fae8fe3c0fcab63d6a231 (commit)
via da928d305b10445c2a736597d87fb2a8c4409eb7 (commit)
via 1f085e11e40a20f8e8702da7920e950e47deb27c (commit)
via 85d3173590e4bae63e8422ac8083a77806491b92 (commit)
from ce9f6273812be91e47f61a86b676e17f9b2c30fb (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=e9ecfbc0de78bda55e0fae8fe3c0fcab63d6a231
commit e9ecfbc0de78bda55e0fae8fe3c0fcab63d6a231
Merge: ce9f627 da928d3
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 14 15:27:52 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jan 14 15:27:52 2015 -0500
Merge topic 'Apple-compiler-selection' into next
da928d30 Help: Add notes for topic 'Apple-compiler-selection'
1f085e11 OS X: Resolve compiler in /usr/bin to that reported by Xcode xcrun
85d31735 CMakeDetermineCompiler: Factor out xcrun invocation into a macro
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=da928d305b10445c2a736597d87fb2a8c4409eb7
commit da928d305b10445c2a736597d87fb2a8c4409eb7
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 14 15:13:33 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 14 15:27:06 2015 -0500
Help: Add notes for topic 'Apple-compiler-selection'
diff --git a/Help/release/dev/Apple-compiler-selection.rst b/Help/release/dev/Apple-compiler-selection.rst
new file mode 100644
index 0000000..5ff5653
--- /dev/null
+++ b/Help/release/dev/Apple-compiler-selection.rst
@@ -0,0 +1,8 @@
+Apple-compiler-selection
+------------------------
+
+* On OS X with Makefile and Ninja generators, when a compiler is found
+ in ``/usr/bin`` it is now mapped to the corresponding compiler inside
+ the Xcode application folder, if any. This allows such build
+ trees to continue to work with their original compiler even when
+ ``xcode-select`` switches to a different Xcode installation.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f085e11e40a20f8e8702da7920e950e47deb27c
commit 1f085e11e40a20f8e8702da7920e950e47deb27c
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jan 3 17:36:34 2015 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 14 15:26:53 2015 -0500
OS X: Resolve compiler in /usr/bin to that reported by Xcode xcrun
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.
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 7a5cbcd..85c8662 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_xcrun compiler_name result_var_keyword result_var)
if(NOT "x${result_var_keyword}" STREQUAL "xRESULT_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_xcrun("${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_xcrun("${CMAKE_MATCH_1}" RESULT_VAR xcrun_result)
+ elseif (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND")
+ foreach(comp ${CMAKE_${lang}_COMPILER_LIST})
+ _query_xcrun("${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=85d3173590e4bae63e8422ac8083a77806491b92
commit 85d3173590e4bae63e8422ac8083a77806491b92
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jan 13 23:10:46 2015 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 14 15:26:26 2015 -0500
CMakeDetermineCompiler: Factor out xcrun invocation into a macro
This will allow it to be re-used in multiple code paths later.
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 0ab3af6..7a5cbcd 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_xcrun compiler_name result_var_keyword result_var)
+ if(NOT "x${result_var_keyword}" STREQUAL "xRESULT_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_xcrun("${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