diff options
author | Brad King <brad.king@kitware.com> | 2014-10-23 12:32:32 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-10-23 12:32:32 (GMT) |
commit | b2a7f60a4660ced5892e47eb1e7dd560313c340c (patch) | |
tree | a9aa3234e59b32fea19003e97ecf2645090dad54 /Modules/CMakeDetermineCompilerId.cmake | |
parent | 2a668e20da7ba6ae380eb44219f285f13fd34981 (diff) | |
parent | b91020f659ddc7d50868b3face370d9221c4c2dd (diff) | |
download | CMake-b2a7f60a4660ced5892e47eb1e7dd560313c340c.zip CMake-b2a7f60a4660ced5892e47eb1e7dd560313c340c.tar.gz CMake-b2a7f60a4660ced5892e47eb1e7dd560313c340c.tar.bz2 |
Merge topic 'xcode-ios-compiler-id'
b91020f6 Xcode: Fix compiler id detection when code signing is required
c48f6e12 Xcode: Fix compiler id detection for iOS tools (#15214)
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 9ab159a..9ce99f9 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -261,11 +261,20 @@ Id flags: ${testflags} else() set(id_deployment_target "") endif() + 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() else() set(id_sdkroot "") endif() + if(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY) + set(id_code_sign_identity "CODE_SIGN_IDENTITY = \"${CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY}\";") + else() + set(id_code_sign_identity "") + endif() if(NOT ${XCODE_VERSION} VERSION_LESS 3) set(v 3) set(ext xcodeproj) @@ -298,7 +307,7 @@ Id flags: ${testflags} # ... # /path/to/cc ...CompilerId${lang}/... # 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}[ \t\n\\\"]") + 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\\\"]") set(_comp "${CMAKE_MATCH_2}") if(EXISTS "${_comp}") set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE) @@ -366,7 +375,13 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} # binary dir. file(GLOB files RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR} - ${CMAKE_${lang}_COMPILER_ID_DIR}/*) + + # normal case + ${CMAKE_${lang}_COMPILER_ID_DIR}/* + + # com.apple.package-type.bundle.unit-test + ${CMAKE_${lang}_COMPILER_ID_DIR}/*.xctest/* + ) list(REMOVE_ITEM files "${src}") set(COMPILER_${lang}_PRODUCED_FILES "") foreach(file ${files}) |