aboutsummaryrefslogtreecommitdiff
path: root/interpreter.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-10-20 20:46:42 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2015-10-20 20:46:42 +0300
commit538073a9cf300d68980d55aa43c68008f2e88a65 (patch)
tree2a2933b5d9e569935f7cc4517b6201de7c8c7b91 /interpreter.py
parent910dcbf290242fc099a7dd14f0c55cec9ce5dd7e (diff)
downloadmeson-538073a9cf300d68980d55aa43c68008f2e88a65.zip
meson-538073a9cf300d68980d55aa43c68008f2e88a65.tar.gz
meson-538073a9cf300d68980d55aa43c68008f2e88a65.tar.bz2
Created a link test method.
Diffstat (limited to 'interpreter.py')
-rw-r--r--interpreter.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/interpreter.py b/interpreter.py
index 968b2b9..9d57136 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -564,6 +564,7 @@ class CompilerHolder(InterpreterObject):
self.compiler = compiler
self.environment = env
self.methods.update({'compiles': self.compiles_method,
+ 'links': self.links_method,
'get_id': self.get_id_method,
'sizeof': self.sizeof_method,
'has_header': self.has_header_method,
@@ -692,6 +693,25 @@ class CompilerHolder(InterpreterObject):
mlog.log('Checking if "', mlog.bold(testname), '" compiles : ', h, sep='')
return result
+ def links_method(self, args, kwargs):
+ if len(args) != 1:
+ raise InterpreterException('links method takes exactly one argument.')
+ check_stringlist(args)
+ string = 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)
+ if len(testname) > 0:
+ if result:
+ h = mlog.green('YES')
+ else:
+ h = mlog.red('NO')
+ mlog.log('Checking if "', mlog.bold(testname), '" links : ', h, sep='')
+ return result
+
def has_header_method(self, args, kwargs):
if len(args) != 1:
raise InterpreterException('has_header method takes exactly one argument.')