[Mesa-dev] [PATCH 10/14] meson: handle LLVM 'x.x.xgit-revision' versions

Greg V greg at unrelenting.technology
Sun Dec 31 16:55:24 UTC 2017


When LLVM is built inside of a git repo (even way below, e.g. /usr/ports/.git
exists, and LLVM is built in /usr/ports/devel/llvm50/work), its version
becomes something like 5.0.0git-f8ab206b2176.

Don't blow up on these versions.
---
 meson.build | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meson.build b/meson.build
index 23faad0a71..0e8e695965 100644
--- a/meson.build
+++ b/meson.build
@@ -994,9 +994,12 @@ if with_llvm
   _llvm_version = dep_llvm.version().split('.')
   # Development versions of LLVM have an 'svn' suffix, we don't want that for
   # our version checks.
+  # Also LLVM can end up with a 'git-$revision' suffix if built inside a git repo.
   _llvm_patch = _llvm_version[2]
   if _llvm_patch.endswith('svn')
     _llvm_patch = _llvm_patch.split('s')[0]
+  elif _llvm_patch.contains('git')
+    _llvm_patch = _llvm_patch.split('g')[0]
   endif
   pre_args += [
     '-DHAVE_LLVM=0x0 at 0@@1@@2@'.format(_llvm_version[0], _llvm_version[1], _llvm_patch),
-- 
2.15.1



More information about the mesa-dev mailing list