diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-10-20 20:55:10 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-10-20 22:04:50 +0300 |
commit | 0c63556286661be83d64739d0a5422cca2d1b95e (patch) | |
tree | 10301280326650400e0adee7cb95ecfd1d6b58b1 | |
parent | 538073a9cf300d68980d55aa43c68008f2e88a65 (diff) | |
download | meson-0c63556286661be83d64739d0a5422cca2d1b95e.zip meson-0c63556286661be83d64739d0a5422cca2d1b95e.tar.gz meson-0c63556286661be83d64739d0a5422cca2d1b95e.tar.bz2 |
Extra args also for compiles. Closes #292.
-rw-r--r-- | compilers.py | 3 | ||||
-rw-r--r-- | interpreter.py | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/compilers.py b/compilers.py index ee5cc10..78da486 100644 --- a/compilers.py +++ b/compilers.py @@ -156,6 +156,9 @@ class Compiler(): def compiles(self, code): raise EnvironmentException('Language %s does not support compile checks.' % self.language) + def links(self, code): + raise EnvironmentException('Language %s does not support link checks.' % self.language) + def run(self, code): raise EnvironmentException('Language %s does not support run checks.' % self.language) diff --git a/interpreter.py b/interpreter.py index 9d57136..9e8aa7c 100644 --- a/interpreter.py +++ b/interpreter.py @@ -680,11 +680,12 @@ class CompilerHolder(InterpreterObject): if len(args) != 1: raise InterpreterException('compiles method takes exactly one argument.') check_stringlist(args) - string = args[0] + code = args[0] testname = kwargs.get('name', '') if not isinstance(testname, str): raise InterpreterException('Testname argument must be a string.') - result = self.compiler.compiles(string) + args = mesonlib.stringlistify(kwargs.get('args', [])) + result = self.compiler.compiles(code, args) if len(testname) > 0: if result: h = mlog.green('YES') @@ -697,13 +698,12 @@ class CompilerHolder(InterpreterObject): if len(args) != 1: raise InterpreterException('links method takes exactly one argument.') check_stringlist(args) - string = args[0] + code = args[0] testname = kwargs.get('name', '') if not isinstance(testname, str): raise InterpreterException('Testname argument must be a string.') - args = kwargs.get('args', []) - args = mesonlib.stringlistify(args) - result = self.compiler.links(string, args) + args = mesonlib.stringlistify(kwargs.get('args', [])) + result = self.compiler.links(code, args) if len(testname) > 0: if result: h = mlog.green('YES') |