[RFC PATCH 03/12] build: prevent overlap of enable and disable lists

Bruce Richardson bruce.richardson at intel.com
Fri Oct 16 12:59:41 CEST 2026


For enable_libs/disable_libs option, and the driver and app equivalents,
detect if a component is in both enable and disable lists and error out
if so.

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
 app/meson.build     | 5 +++++
 drivers/meson.build | 5 +++++
 lib/meson.build     | 5 +++++
 3 files changed, 15 insertions(+)

diff --git a/app/meson.build b/app/meson.build
index 4515688471..7472d925b2 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -6,6 +6,11 @@ disable_apps = run_command(list_dir_globs, disable_apps, check: true).stdout().s
 
 enable_apps = ',' + get_option('enable_apps')
 enable_apps = run_command(list_dir_globs, enable_apps, check: true).stdout().split()
+foreach a:enable_apps
+    if disable_apps.contains(a)
+        error('Application "@0@" is in both "enable_apps" and "disable_apps".'.format(a))
+    endif
+endforeach
 require_apps = true
 if enable_apps.length() == 0
     require_apps = false
diff --git a/drivers/meson.build b/drivers/meson.build
index b761e19be5..440c3959cf 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -71,6 +71,11 @@ endforeach
 
 disable_drivers = run_command(list_dir_globs, disable_drivers, check: true).stdout().split()
 enable_drivers = run_command(list_dir_globs, enable_drivers, check: true).stdout().split()
+foreach d:enable_drivers
+    if disable_drivers.contains(d)
+        error('Driver "@0@" is in both "enable_drivers" and "disable_drivers".'.format(d))
+    endif
+endforeach
 require_drivers = true
 if enable_drivers.length() == 0
     require_drivers = false
diff --git a/lib/meson.build b/lib/meson.build
index af5c160cb8..0c5da21522 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -101,6 +101,11 @@ endforeach
 disable_libs = run_command(list_dir_globs, get_option('disable_libs'), check: true).stdout().split()
 
 enable_libs = run_command(list_dir_globs, get_option('enable_libs'), check: true).stdout().split()
+foreach l:enable_libs
+    if disable_libs.contains(l)
+        error('Library "@0@" is in both "enable_libs" and "disable_libs".'.format(l))
+    endif
+endforeach
 require_libs = true
 if enable_libs.length() == 0
     require_libs = false
-- 
2.53.0



More information about the dev mailing list