summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg V <[email protected]>2018-01-24 21:02:43 +0300
committerEmil Velikov <[email protected]>2018-01-26 19:53:02 +0000
commitb01ea9701e328896659a5ffad79f2762f177a087 (patch)
tree48a8f66fa2e6b46a454f8b34dfec9b299134740d
parentbf22d563f5e8984c7efb90425cb50d168fc3b8d9 (diff)
meson: handle LLVM 'x.x.xgit-revision' versions
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. New meson versions already handle this, but we support older versions too. Fixes: 673dda8330769 ("meson: build "radv" vulkan driver for radeon hardware") Reviewed-by: Dylan Baker <[email protected]> (cherry picked from commit 8fae5eddd9982f4586d76471d0196befeb46de24)
-rw-r--r--meson.build8
1 files changed, 6 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index f440ddda9db..1a31f397331 100644
--- a/meson.build
+++ b/meson.build
@@ -1022,11 +1022,15 @@ else
endif
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.
+ # Development versions of LLVM have an 'svn' or 'git' suffix, we don't want
+ # that for our version checks.
+ # svn suffixes are stripped by meson as of 0.43, and git suffixes are
+ # strippped as of 0.44, but we support older meson versions.
_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@0@@1@@2@'.format(_llvm_version[0], _llvm_version[1], _llvm_patch),