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: Iaf683f8589b9348184ad75bdf2d62a9ef8a776c2
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meson.build b/meson.build
index 80c1547..075cddc 100644
--- a/meson.build
+++ b/meson.build
@@ -17,7 +17,7 @@
conf_data.set_quoted('PIM_PERSIST_PATH', '/var/lib/phosphor-inventory-manager')
conf_data.set_quoted('ASSOCIATIONS_FILE_PATH', '/usr/share/phosphor-inventory-manager/associations.json')
conf_data.set('CLASS_VERSION', 2)
-conf_data.set('CREATE_ASSOCIATIONS', get_option('associations').enabled())
+conf_data.set('CREATE_ASSOCIATIONS', get_option('associations').allowed())
configure_file(output: 'config.h',
configuration: conf_data
)
@@ -49,7 +49,7 @@
sources = []
deps = []
-if get_option('associations').enabled()
+if get_option('associations').allowed()
cpp = meson.get_compiler('cpp')
if cpp.has_header('nlohmann/json.hpp')
nlohmann_json_dep = declare_dependency()