meson: explicit 'enabled' should spit errors if not found
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 13 Mar 2024 05:42:31 +0000 (14:42 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Thu, 14 Mar 2024 05:12:07 +0000 (14:12 +0900)
If -Dsupport-ncnn=enabled is given and ncnn is not found,
an error should be generated by meson.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
meson.build

index 92ee899..a4555e1 100644 (file)
@@ -547,7 +547,9 @@ foreach feature_name, data : features
     endif
   endforeach
 
-  if get_option(feature_name).disabled() or not _available
+  if get_option(feature_name).enabled() and not _available
+    error('@0@ is enabled, but unable to find the target dependency'.format(feature_name))
+  elif get_option(feature_name).disabled() or not _available
     project_args += data.get('project_args_disabled', {})
     set_variable(variable_deps_name, [])
     set_variable(variable_available_name, false)