diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-12-02 03:08:38 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-12-02 03:08:38 +0000 |
commit | 37c3ef4b196baabdc1182068d5e242893ec59818 (patch) | |
tree | 0a264756a86bd51ed893f878a6cde2dabe1be806 /CMakeLists.txt | |
parent | da7accb90f57f4657967c22d89f3e76a3a6118a3 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223106 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f5e0921b0..35d8d690ed 100644 --- a/CMakeLists.txt +++ b/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() |