[PATCH libdrm v2 08/23] meson: introduce simpler way to handle driver options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Eric Engestrom <eric.engestrom@xxxxxxxxxx>
---
 meson.build | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/meson.build b/meson.build
index 5b6710ee8dc16b02dbed..8efa99b54e6a108b8255 100644
--- a/meson.build
+++ b/meson.build
@@ -69,6 +69,27 @@ endif
 config.set10('HAVE_LIBDRM_ATOMIC_PRIMITIVES', intel_atomics)
 config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
 
+foreach d : [
+]
+  driver = d[0]
+  require_atomics = d[1]
+  default = d[2]
+  _option = get_option(driver)
+
+  if _option == 'auto'
+    if with_atomics or not require_atomics
+      set_variable('with_' + driver, default)
+    else
+      set_variable('with_' + driver, false)
+    endif
+  else
+    if _option == 'true' and require_atomics and not with_atomics
+      error('libdrm_' + driver + ' requires atomics.')
+    endif
+    set_variable('with_' + driver, _option == 'true')
+  endif
+endforeach
+
 with_intel = false
 _intel = get_option('intel')
 if _intel == 'auto'
-- 
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux