From: Hans Wennborg Date: Tue, 2 Dec 2014 03:08:38 +0000 (+0000) Subject: CMake: make the regexes used for setting HOST_LINK_VERSION more forgiving (PR21268) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76abe8ef98c6743424d3bf7fc0b9f95c29cee026;p=platform%2Fupstream%2Fllvm.git CMake: make the regexes used for setting HOST_LINK_VERSION more forgiving (PR21268) 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 --- diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index 7f5e092..35d8d69 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -265,7 +265,7 @@ if (APPLE) 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()