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: I2ce48ae6fe133c0b355672b5bb7d7c27bc6b3702
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meson.build b/meson.build
index f9db931..4ff60b0 100644
--- a/meson.build
+++ b/meson.build
@@ -34,7 +34,7 @@
add_project_arguments('-DMAPPER_ENABLE_DEBUG', language : 'cpp')
endif
-if get_option('tests').enabled()
+if get_option('tests').allowed()
gtest = dependency('gtest', main: true, disabler: true, required: false)
gmock = dependency('gmock', disabler: true, required: false)
if not gtest.found() or not gmock.found()
@@ -50,7 +50,7 @@
gmock = gtest_proj.dependency('gmock')
else
assert(
- not get_option('tests').enabled(),
+ not get_option('tests').allowed(),
'Googletest is required if tests are enabled'
)
endif