aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase.py
diff options
context:
space:
mode:
authorbehlec <33778676+behlec@users.noreply.github.com>2018-03-29 20:29:45 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2018-03-29 21:29:45 +0300
commit37d379ebe5ebf935297fe18478dfa311afa64d24 (patch)
tree04464fc8a034e978f022a424719901e2d056aa43 /mesonbuild/interpreterbase.py
parent6146353f454a6db709309ad47798df87462097c9 (diff)
downloadmeson-37d379ebe5ebf935297fe18478dfa311afa64d24.zip
meson-37d379ebe5ebf935297fe18478dfa311afa64d24.tar.gz
meson-37d379ebe5ebf935297fe18478dfa311afa64d24.tar.bz2
Allow meson build file to exit early. (#2808)
Diffstat (limited to 'mesonbuild/interpreterbase.py')
-rw-r--r--mesonbuild/interpreterbase.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py
index 9279506..f957d90 100644
--- a/mesonbuild/interpreterbase.py
+++ b/mesonbuild/interpreterbase.py
@@ -105,6 +105,9 @@ class InvalidCode(InterpreterException):
class InvalidArguments(InterpreterException):
pass
+class SubdirDoneRequest(BaseException):
+ pass
+
class InterpreterObject:
def __init__(self):
self.methods = {}
@@ -203,6 +206,8 @@ class InterpreterBase:
try:
self.current_lineno = cur.lineno
self.evaluate_statement(cur)
+ except SubdirDoneRequest:
+ break
except Exception as e:
if not(hasattr(e, 'lineno')):
e.lineno = cur.lineno