If the output of 'ld -v' didn't match the regexes, CMake would previously error
with a message like:
CMake Error at tools/clang/CMakeLists.txt:269 (string):
string sub-command REGEX, mode REPLACE regex "[^0-9]*([0-9.]*).*" matched
an empty string.
llvm-svn: 223106
if (NOT HAD_ERROR)
if ("${LD_V_OUTPUT}" MATCHES ".*ld64.*")
string(REGEX REPLACE ".*ld64-([0-9.]*).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})
- else()
+ elseif ("${LD_V_OUTPUT}" MATCHES "[^0-9]*([0-9.]*).*")
string(REGEX REPLACE "[^0-9]*([0-9.]*).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})
endif()
else()