Checks for all build target functions.

pull/2001/head
Jussi Pakkanen 8 years ago
parent 92493d4e5e
commit 0eb41a9a08
  1. 55
      mesonbuild/interpreter.py

@ -1225,28 +1225,46 @@ lang_arg_kwargs = set(['c_args',
'fortran_args', 'fortran_args',
'vala_args']) 'vala_args'])
exe_kwargs = set(['sources', buildtarget_kwargs = set(['sources',
'link_with', 'link_with',
'link_whole', 'link_whole',
'link_args', 'link_args',
'link_depends', 'link_depends',
'include_directories', 'include_directories',
'dependencies', 'dependencies',
'gui_app', 'gui_app',
'extra_files', 'extra_files',
'install', 'install',
'install_rpath', 'install_rpath',
'install_dir', 'install_dir',
'objects', 'objects',
'native', 'native',
'name_suffix', 'name_suffix',
'build_by_default', 'name_prefix',
'override_options']) 'build_by_default',
'vs_module_defs',
'pic',
'override_options'])
exe_kwargs = set()
exe_kwargs.update(buildtarget_kwargs)
exe_kwargs.update(lang_arg_kwargs) exe_kwargs.update(lang_arg_kwargs)
exe_kwargs.update(pch_kwargs) exe_kwargs.update(pch_kwargs)
shlib_kwargs = set()
shlib_kwargs.update(buildtarget_kwargs)
shlib_kwargs.update(lang_arg_kwargs)
shlib_kwargs.update(pch_kwargs)
shlib_kwargs.update(['version', 'soversion'])
shmod_kwargs = shlib_kwargs
stlib_kwargs = shlib_kwargs
permitted_kwargs = {'project': set(['version', 'meson_version', 'default_options', 'license', 'subproject_dir']), permitted_kwargs = {'project': set(['version', 'meson_version', 'default_options', 'license', 'subproject_dir']),
'executable': exe_kwargs, 'executable': exe_kwargs,
'shared_library': shlib_kwargs,
'static_library': stlib_kwargs,
'shared_module': shmod_kwargs,
} }
@ -2042,12 +2060,15 @@ class Interpreter(InterpreterBase):
def func_executable(self, node, args, kwargs): def func_executable(self, node, args, kwargs):
return self.build_target(node, args, kwargs, ExecutableHolder) return self.build_target(node, args, kwargs, ExecutableHolder)
@permittedKwargs(permitted_kwargs['static_library'])
def func_static_lib(self, node, args, kwargs): def func_static_lib(self, node, args, kwargs):
return self.build_target(node, args, kwargs, StaticLibraryHolder) return self.build_target(node, args, kwargs, StaticLibraryHolder)
@permittedKwargs(permitted_kwargs['shared_library'])
def func_shared_lib(self, node, args, kwargs): def func_shared_lib(self, node, args, kwargs):
return self.build_target(node, args, kwargs, SharedLibraryHolder) return self.build_target(node, args, kwargs, SharedLibraryHolder)
@permittedKwargs(permitted_kwargs['shared_module'])
def func_shared_module(self, node, args, kwargs): def func_shared_module(self, node, args, kwargs):
return self.build_target(node, args, kwargs, SharedModuleHolder) return self.build_target(node, args, kwargs, SharedModuleHolder)

Loading…
Cancel
Save