build: use allowed over enabled
Meson feature options are typically in a tri-state of enabled, disabled,
or auto. The enabled and disabled functions on an option (from
`get_option`) no longer return true for auto features. Instead, the
expectation is to use `allowed()` which is true for both enabled and auto.
Switch all uses of `enabled` to `allowed`.
Change-Id: I50f949d6323c4ff17e48901a56f7e34a76ca46db
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meson.build b/meson.build
index 90cae2f..fd59f32 100644
--- a/meson.build
+++ b/meson.build
@@ -9,7 +9,7 @@
]
)
-if get_option('root_user_mgmt').enabled()
+if get_option('root_user_mgmt').allowed()
add_project_arguments('-DENABLE_ROOT_USER_MGMT', language:'cpp')
endif
@@ -153,6 +153,6 @@
subdir('phosphor-ldap-config')
-if get_option('tests').enabled()
+if get_option('tests').allowed()
subdir('test')
endif
diff --git a/test/meson.build b/test/meson.build
index f1d7af8..94b8b0f 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -13,7 +13,7 @@
gmock_dep = gtest_proj.dependency('gmock')
else
assert(
- not get_option('tests').enabled(),
+ not get_option('tests').allowed(),
'Googletest is required if tests are enabled'
)
endif