Print warning if using "default_options" without a "fallback".

pull/4691/head
Jussi Pakkanen 6 years ago
parent 1fca654055
commit ab3aeeffe9
  1. 2
      mesonbuild/interpreter.py

@ -3070,6 +3070,8 @@ external dependencies (including libraries) must go to "dependencies".''')
if disabled: if disabled:
mlog.log('Dependency', mlog.bold(display_name), 'skipped: feature', mlog.bold(feature), 'disabled') mlog.log('Dependency', mlog.bold(display_name), 'skipped: feature', mlog.bold(feature), 'disabled')
return DependencyHolder(NotFoundDependency(self.environment), self.subproject) return DependencyHolder(NotFoundDependency(self.environment), self.subproject)
if'default_options' in kwargs and 'fallback' not in kwargs:
mlog.warning('The "default_options" keyworg argument does nothing without a "fallback" keyword argument.')
# writing just "dependency('')" is an error, because it can only fail # writing just "dependency('')" is an error, because it can only fail
if name == '' and required and 'fallback' not in kwargs: if name == '' and required and 'fallback' not in kwargs:

Loading…
Cancel
Save