[PATCH libdrm v2 08/23] meson: introduce simpler way to handle driver options
Eric Engestrom
eric.engestrom at imgtec.com
Wed Apr 4 15:38:03 UTC 2018
Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
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
More information about the dri-devel
mailing list