diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2014-08-12 22:44:16 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2014-08-12 22:44:16 +0300 |
commit | 81a7c41799dfec3c55d0483e746980dafdb38fab (patch) | |
tree | 2d70eeb78043f8197bf7d45df7819c099b11ed2d /build.py | |
parent | fcbe6895614df62c2035559e276bb538d5770098 (diff) | |
download | meson-81a7c41799dfec3c55d0483e746980dafdb38fab.zip meson-81a7c41799dfec3c55d0483e746980dafdb38fab.tar.gz meson-81a7c41799dfec3c55d0483e746980dafdb38fab.tar.bz2 |
Print a warning on unknown keyword arguments on build targets.
Diffstat (limited to 'build.py')
-rw-r--r-- | build.py | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -15,6 +15,7 @@ import coredata import environment import dependencies +import mlog import copy, os class InvalidArguments(coredata.MesonException): @@ -117,6 +118,31 @@ class ExtractedObjects(): self.srclist = srclist class BuildTarget(): + # All keyword arguments that we know how to handle. + known_kwargs = {'ui_files': True, + 'moc_headers' : True, + 'qresources' : True, + 'moc_sources' : True, + 'install' : True, + 'c_pch' : True, + 'cpp_pch' : True, + 'c_args' : True, + 'cpp_args' : True, + 'cs_args' : True, + 'link_args' : True, + 'link_depends': True, + 'include_directories': True, + 'dependencies' : True, + 'install_dir' : True, + 'main_class' : True, + 'gui_app' : True, + 'extra_files' : True, + 'install_rpath' : True, + 'resources' : True, + 'sources' : True, + 'objects' : True, + } + def __init__(self, name, subdir, is_cross, sources, objects, environment, kwargs): self.name = name self.subdir = subdir @@ -136,6 +162,13 @@ class BuildTarget(): self.process_sourcelist(sources) self.process_objectlist(objects) self.process_kwargs(kwargs, environment) + unknowns = [] + for k in kwargs: + if not k in BuildTarget.known_kwargs: + unknowns.append(k) + if len(unknowns) > 0: + mlog.log(mlog.bold('Warning:'), 'Unknown keyword argument(s) in target %s: %s.' % + (self.name, ', '.join(unknowns))) if len(self.sources) == 0 and len(self.generated) == 0: raise InvalidArguments('Build target %s has no sources.' % name) self.validate_sources() |