[cmake][xcode-toolchain] add support for major Xcode version >= 10

The regex that extracts the Xcode version should support major versions with two
digits.

rdar://41465184

llvm-svn: 335801
This commit is contained in:
Alex Lorenz 2018-06-28 00:39:09 +00:00
parent 4d5fa3cc78
commit fc76bbc06d

View File

@ -49,7 +49,7 @@ if(NOT XCODE_VERSION)
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_FILE /dev/null
)
string(REGEX MATCH "Xcode ([0-9]([.][0-9])+)" version_match ${xcodebuild_version})
string(REGEX MATCH "Xcode ([0-9][0-9]?([.][0-9])+)" version_match ${xcodebuild_version})
if(version_match)
message(STATUS "Identified Xcode Version: ${CMAKE_MATCH_1}")
set(XCODE_VERSION ${CMAKE_MATCH_1})