[cmake-developers] [PATCH] Retrieve Xcode CompilerId via static libraries
Gregor Jasny
gjasny at googlemail.com
Sun Jan 11 14:25:55 EST 2015
The current approach to determine the CompilerId via
an XCTest bundle on iOS requires a valid code sign identity.
This is a regression compared to CMake 3.0. This patch changes
the detection to be performed on a static library and also
unifies detection across iOS and OSX.
This has been tested on OSX 10.10 with Xcode 6.1.1.
Signed-off-by: Gregor Jasny <gjasny at googlemail.com>
---
Modules/CMakeDetermineCompilerId.cmake | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 0ea9ce1..85934a3 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -264,9 +264,7 @@ Id flags: ${testflags}
set(id_product_type "com.apple.product-type.tool")
if(CMAKE_OSX_SYSROOT)
set(id_sdkroot "SDKROOT = \"${CMAKE_OSX_SYSROOT}\";")
- if(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ii][Pp][Hh][Oo][Nn][Ee]")
- set(id_product_type "com.apple.product-type.bundle.unit-test")
- endif()
+ set(id_product_type "com.apple.product-type.library.static")
else()
set(id_sdkroot "")
endif()
@@ -303,11 +301,11 @@ Id flags: ${testflags}
endif()
# Match the link line from xcodebuild output of the form
- # Ld ...
+ # CompileC ...
# ...
- # /path/to/cc ...CompilerId${lang}/...
+ # /path/to/cc ...-o CMake${lang}CompilerId.o
# to extract the compiler front-end for the language.
- if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerId${lang}/(\\./)?(CompilerId${lang}.xctest/)?CompilerId${lang}[ \t\n\\\"]")
+ if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "\nCompileC[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[ \t][^ \t\r\n]*CMake${lang}CompilerId.o[ \t\n\\\"]")
set(_comp "${CMAKE_MATCH_2}")
if(EXISTS "${_comp}")
set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE)
--
1.9.3 (Apple Git-50)
More information about the cmake-developers
mailing list