r223106 - CMake: make the regexes used for setting HOST_LINK_VERSION more forgiving (PR21268)

Hans Wennborg hans at hanshq.net
Mon Dec 1 19:08:39 PST 2014


Author: hans
Date: Mon Dec  1 21:08:38 2014
New Revision: 223106

URL: http://llvm.org/viewvc/llvm-project?rev=223106&view=rev
Log:
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.

Modified:
    cfe/trunk/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=223106&r1=223105&r2=223106&view=diff
==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Mon Dec  1 21:08:38 2014
@@ -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()





More information about the cfe-commits mailing list