|
|
@ -1278,7 +1278,7 @@ class Interpreter(InterpreterBase): |
|
|
|
if len(args) != 1: |
|
|
|
if len(args) != 1: |
|
|
|
raise InvalidCode('Import takes one argument.') |
|
|
|
raise InvalidCode('Import takes one argument.') |
|
|
|
modname = args[0] |
|
|
|
modname = args[0] |
|
|
|
if not modname in self.environment.coredata.modules: |
|
|
|
if modname not in self.environment.coredata.modules: |
|
|
|
module = importlib.import_module('mesonbuild.modules.' + modname).initialize() |
|
|
|
module = importlib.import_module('mesonbuild.modules.' + modname).initialize() |
|
|
|
self.environment.coredata.modules[modname] = module |
|
|
|
self.environment.coredata.modules[modname] = module |
|
|
|
return ModuleHolder(modname, self.environment.coredata.modules[modname], self) |
|
|
|
return ModuleHolder(modname, self.environment.coredata.modules[modname], self) |
|
|
@ -1509,7 +1509,7 @@ class Interpreter(InterpreterBase): |
|
|
|
self.add_languages(args[1:], True) |
|
|
|
self.add_languages(args[1:], True) |
|
|
|
langs = self.coredata.compilers.keys() |
|
|
|
langs = self.coredata.compilers.keys() |
|
|
|
if 'vala' in langs: |
|
|
|
if 'vala' in langs: |
|
|
|
if not 'c' in langs: |
|
|
|
if 'c' not in langs: |
|
|
|
raise InterpreterException('Compiling Vala requires C. Add C to your project languages and rerun Meson.') |
|
|
|
raise InterpreterException('Compiling Vala requires C. Add C to your project languages and rerun Meson.') |
|
|
|
if not self.is_subproject(): |
|
|
|
if not self.is_subproject(): |
|
|
|
self.check_cross_stdlibs() |
|
|
|
self.check_cross_stdlibs() |
|
|
@ -1876,7 +1876,7 @@ requirements use the version keyword argument instead.''') |
|
|
|
all_args = args[1:] |
|
|
|
all_args = args[1:] |
|
|
|
deps = [] |
|
|
|
deps = [] |
|
|
|
elif len(args) == 1: |
|
|
|
elif len(args) == 1: |
|
|
|
if not 'command' in kwargs: |
|
|
|
if 'command' not in kwargs: |
|
|
|
raise InterpreterException('Missing "command" keyword argument') |
|
|
|
raise InterpreterException('Missing "command" keyword argument') |
|
|
|
all_args = kwargs['command'] |
|
|
|
all_args = kwargs['command'] |
|
|
|
if not isinstance(all_args, list): |
|
|
|
if not isinstance(all_args, list): |
|
|
@ -2054,7 +2054,7 @@ requirements use the version keyword argument instead.''') |
|
|
|
def func_install_subdir(self, node, args, kwargs): |
|
|
|
def func_install_subdir(self, node, args, kwargs): |
|
|
|
if len(args) != 1: |
|
|
|
if len(args) != 1: |
|
|
|
raise InvalidArguments('Install_subdir requires exactly one argument.') |
|
|
|
raise InvalidArguments('Install_subdir requires exactly one argument.') |
|
|
|
if not 'install_dir' in kwargs: |
|
|
|
if 'install_dir' not in kwargs: |
|
|
|
raise InvalidArguments('Missing keyword argument install_dir') |
|
|
|
raise InvalidArguments('Missing keyword argument install_dir') |
|
|
|
install_dir = kwargs['install_dir'] |
|
|
|
install_dir = kwargs['install_dir'] |
|
|
|
if not isinstance(install_dir, str): |
|
|
|
if not isinstance(install_dir, str): |
|
|
@ -2066,7 +2066,7 @@ requirements use the version keyword argument instead.''') |
|
|
|
def func_configure_file(self, node, args, kwargs): |
|
|
|
def func_configure_file(self, node, args, kwargs): |
|
|
|
if len(args) > 0: |
|
|
|
if len(args) > 0: |
|
|
|
raise InterpreterException("configure_file takes only keyword arguments.") |
|
|
|
raise InterpreterException("configure_file takes only keyword arguments.") |
|
|
|
if not 'output' in kwargs: |
|
|
|
if 'output' not in kwargs: |
|
|
|
raise InterpreterException('Required keyword argument "output" not defined.') |
|
|
|
raise InterpreterException('Required keyword argument "output" not defined.') |
|
|
|
inputfile = kwargs.get('input', None) |
|
|
|
inputfile = kwargs.get('input', None) |
|
|
|
output = kwargs['output'] |
|
|
|
output = kwargs['output'] |
|
|
@ -2137,7 +2137,7 @@ requirements use the version keyword argument instead.''') |
|
|
|
'been declared.\nThis is not permitted. Please declare all ' \ |
|
|
|
'been declared.\nThis is not permitted. Please declare all ' \ |
|
|
|
'global arguments before your targets.' |
|
|
|
'global arguments before your targets.' |
|
|
|
raise InvalidCode(msg) |
|
|
|
raise InvalidCode(msg) |
|
|
|
if not 'language' in kwargs: |
|
|
|
if 'language' not in kwargs: |
|
|
|
raise InvalidCode('Missing language definition in add_global_arguments') |
|
|
|
raise InvalidCode('Missing language definition in add_global_arguments') |
|
|
|
lang = kwargs['language'].lower() |
|
|
|
lang = kwargs['language'].lower() |
|
|
|
if lang in self.build.global_args: |
|
|
|
if lang in self.build.global_args: |
|
|
@ -2160,7 +2160,7 @@ requirements use the version keyword argument instead.''') |
|
|
|
'been declared.\nThis is not permitted. Please declare all ' \ |
|
|
|
'been declared.\nThis is not permitted. Please declare all ' \ |
|
|
|
'global arguments before your targets.' |
|
|
|
'global arguments before your targets.' |
|
|
|
raise InvalidCode(msg) |
|
|
|
raise InvalidCode(msg) |
|
|
|
if not 'language' in kwargs: |
|
|
|
if 'language' not in kwargs: |
|
|
|
raise InvalidCode('Missing language definition in add_global_link_arguments') |
|
|
|
raise InvalidCode('Missing language definition in add_global_link_arguments') |
|
|
|
lang = kwargs['language'].lower() |
|
|
|
lang = kwargs['language'].lower() |
|
|
|
if lang in self.build.global_link_args: |
|
|
|
if lang in self.build.global_link_args: |
|
|
@ -2175,7 +2175,7 @@ requirements use the version keyword argument instead.''') |
|
|
|
'been declared.\nThis is not permitted. Please declare all ' \ |
|
|
|
'been declared.\nThis is not permitted. Please declare all ' \ |
|
|
|
'project link arguments before your targets.' |
|
|
|
'project link arguments before your targets.' |
|
|
|
raise InvalidCode(msg) |
|
|
|
raise InvalidCode(msg) |
|
|
|
if not 'language' in kwargs: |
|
|
|
if 'language' not in kwargs: |
|
|
|
raise InvalidCode('Missing language definition in add_project_link_arguments') |
|
|
|
raise InvalidCode('Missing language definition in add_project_link_arguments') |
|
|
|
lang = kwargs['language'].lower() |
|
|
|
lang = kwargs['language'].lower() |
|
|
|
if self.subproject not in self.build.projects_link_args: |
|
|
|
if self.subproject not in self.build.projects_link_args: |
|
|
@ -2192,7 +2192,7 @@ requirements use the version keyword argument instead.''') |
|
|
|
'project arguments before your targets.' |
|
|
|
'project arguments before your targets.' |
|
|
|
raise InvalidCode(msg) |
|
|
|
raise InvalidCode(msg) |
|
|
|
|
|
|
|
|
|
|
|
if not 'language' in kwargs: |
|
|
|
if 'language' not in kwargs: |
|
|
|
raise InvalidCode('Missing language definition in add_project_arguments') |
|
|
|
raise InvalidCode('Missing language definition in add_project_arguments') |
|
|
|
|
|
|
|
|
|
|
|
if self.subproject not in self.build.projects_args: |
|
|
|
if self.subproject not in self.build.projects_args: |
|
|
|