diff options
author | Simon Ser <contact@emersion.fr> | 2022-09-28 08:49:40 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-10-03 09:03:30 +0200 |
commit | 0bd3e4e94f8270e64c7fd1e361a71da4a1547b1b (patch) | |
tree | 5d8f12175eb558c998d58970505b70ed27c2dc97 | |
parent | 2df9cc28c05bc0a4de94bfb786897838c8decce6 (diff) | |
download | drm-0bd3e4e94f8270e64c7fd1e361a71da4a1547b1b.tar.gz |
build: automatically disable Intel if pciaccess is not found
Wire up the pciaccess dep to the intel option. This automatically
skips the dep if intel is explicitly disabled, fails if intel is
explicitly enabled and it's not found, and disables intel if it's
set to auto and the dep is not found.
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
-rw-r--r-- | meson.build | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meson.build b/meson.build index 024381d3..0c5172ae 100644 --- a/meson.build +++ b/meson.build @@ -87,13 +87,15 @@ endif config.set10('HAVE_LIBDRM_ATOMIC_PRIMITIVES', intel_atomics) config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics) +dep_pciaccess = dependency('pciaccess', version : '>= 0.10', required : get_option('intel')) + with_intel = false _intel = get_option('intel') if not _intel.disabled() if _intel.enabled() and not with_atomics error('libdrm_intel requires atomics.') else - with_intel = (_intel.enabled() or host_machine.cpu_family().startswith('x86')) and with_atomics + with_intel = (_intel.enabled() or host_machine.cpu_family().startswith('x86')) and with_atomics and dep_pciaccess.found() endif endif summary('Intel', with_intel) @@ -244,7 +246,6 @@ libdrm_c_args = cc.get_supported_arguments([ '-Wno-unused-parameter', '-Wno-attributes', '-Wno-long-long', '-Wno-missing-field-initializers']) -dep_pciaccess = dependency('pciaccess', version : '>= 0.10', required : with_intel) dep_cunit = dependency('cunit', version : '>= 2.1', required : false) dep_cairo = dependency('cairo', required : get_option('cairo-tests')) with_cairo_tests = dep_cairo.found() |