From 99d160385e22ab7bd8e712d5a58460940573cfcd Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 29 Jun 2015 11:19:15 -0400 Subject: CMakeDetermineCompilerId: Use per-language regex to match Xcode compiler tool Move the Ld invocation match expression from CMakeDetermineCompilerId into CMakeDetermine{C,CXX,Fortran}Compiler so that it can be specified on a per-language basis. --- Modules/CMakeDetermineCXXCompiler.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Modules/CMakeDetermineCXXCompiler.cmake') diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index a673525a82..2032015585 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -100,6 +100,14 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN) set(CMAKE_CXX_COMPILER_ID_VENDOR_FLAGS_IAR ) set(CMAKE_CXX_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler") + # Match the link line from xcodebuild output of the form + # Ld ... + # ... + # /path/to/cc ...CompilerIdCXX/... + # to extract the compiler front-end for the language. + set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_REGEX "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerIdCXX/(\\./)?(CompilerIdCXX.xctest/)?CompilerIdCXX[ \t\n\\\"]") + set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_INDEX 2) + include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) CMAKE_DETERMINE_COMPILER_ID(CXX CXXFLAGS CMakeCXXCompilerId.cpp) -- cgit v1.2.1