meson: fix value of `auto` for a bunch of drivers
authorEric Engestrom <eric@engestrom.ch>
Mon, 22 Aug 2022 19:20:40 +0000 (20:20 +0100)
committerEric Engestrom <eric@engestrom.ch>
Mon, 22 Aug 2022 20:06:22 +0000 (21:06 +0100)
You can't have an error if your driver is requested by you're missing
a dep, but then happily build that driver without the dep in `auto`.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
meson.build

index d918afa..70e8730 100644 (file)
@@ -89,7 +89,7 @@ if _intel != 'false'
   if _intel == 'true' and not with_atomics
     error('libdrm_intel requires atomics.')
   else
-    with_intel = _intel == 'true' or host_machine.cpu_family().startswith('x86')
+    with_intel = (_intel == 'true' or host_machine.cpu_family().startswith('x86')) and with_atomics
   endif
 endif
 summary('Intel', with_intel)
@@ -100,7 +100,7 @@ if _radeon != 'false'
   if _radeon == 'true' and not with_atomics
     error('libdrm_radeon requires atomics.')
   endif
-  with_radeon = true
+  with_radeon = with_atomics
 endif
 summary('Radeon', with_radeon)
 
@@ -110,7 +110,7 @@ if _amdgpu != 'false'
   if _amdgpu == 'true' and not with_atomics
     error('libdrm_amdgpu requires atomics.')
   endif
-  with_amdgpu = true
+  with_amdgpu = with_atomics
 endif
 summary('AMDGPU', with_amdgpu)
 
@@ -120,7 +120,7 @@ if _nouveau != 'false'
   if _nouveau == 'true' and not with_atomics
     error('libdrm_nouveau requires atomics.')
   endif
-  with_nouveau = true
+  with_nouveau = with_atomics
 endif
 summary('Nouveau', with_nouveau)
 
@@ -147,7 +147,7 @@ if _freedreno != 'false'
   if _freedreno == 'true' and not with_atomics
     error('libdrm_freedreno requires atomics.')
   else
-    with_freedreno = _freedreno == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
+    with_freedreno = (_freedreno == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())) and with_atomics
   endif
 endif
 summary('Freedreno', with_freedreno)