meson+dri3: allow building against older xcb (v3)
authorRob Clark <robdclark@gmail.com>
Tue, 13 Mar 2018 23:00:45 +0000 (19:00 -0400)
committerRob Clark <robdclark@gmail.com>
Fri, 16 Mar 2018 20:18:42 +0000 (16:18 -0400)
Similar to previous patch, make xcb 1.13 optional.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
meson.build

index 557e9ef3397b4f48e948cfb5e4c4b05be09134d5..a59736f50ae6b32418e01b080f32ec5f06e24e5b 100644 (file)
@@ -1235,9 +1235,14 @@ if with_platform_x11
     dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
 
     if with_dri3
-      pre_args += '-DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS'
-      dep_xcb_dri3 = dependency('xcb-dri3', version : '>= 1.13')
-      dep_xcb_present = dependency('xcb-present', version: '>= 1.13')
+      pre_args += '-DHAVE_DRI3'
+      dep_xcb_dri3 = dependency('xcb-dri3')
+      dep_xcb_present = dependency('xcb-present')
+      # until xcb-dri3 has been around long enough to make a hard-dependency:
+      if (dep_xcb_dri3.version().version_compare('>= 1.13') and
+          dep_xcb_present.version().version_compare('>= 1.13'))
+        pre_args += '-DHAVE_DRI3_MODIFIERS'
+      endif
       dep_xcb_sync = dependency('xcb-sync')
       dep_xshmfence = dependency('xshmfence', version : '>= 1.1')
     endif