From 7f89552a8fc0a3877b9630fdb022eb5f16bc77a3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 7 Nov 2014 16:24:28 -0500 Subject: [PATCH] Xcode: Fix compiler path detection for iOS tools on Xcode <= 5.0 (#15237) Since commit v3.1.0-rc1~1^2~1 (Xcode: Fix compiler id detection for iOS tools, 2014-10-22) our compiler id detection project sets the product type to 'com.apple.product-type.bundle.unit-test'. This causes the Ld command line on which we match the path to the compiler to have a 'CompilerIdC.xctest/' component. The commit updated our regex to match this, but placed it before the extra './' component that Xcode 5.0 and below produce. Xcode <= 5.0 prints '/./CompilerIdC.xctest/', so switch the order of the two components in the regex to match it. --- Modules/CMakeDetermineCompilerId.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 613f4b389..6c6a91483 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -307,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}.xctest)?/(\\./)?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)