aboutsummaryrefslogtreecommitdiff
path: root/build.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-08-12 22:44:16 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2014-08-12 22:44:16 +0300
commit81a7c41799dfec3c55d0483e746980dafdb38fab (patch)
tree2d70eeb78043f8197bf7d45df7819c099b11ed2d /build.py
parentfcbe6895614df62c2035559e276bb538d5770098 (diff)
downloadmeson-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.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/build.py b/build.py
index 6a74c0e..c8181f0 100644
--- a/build.py
+++ b/build.py
@@ -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()