aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-07-02 02:56:01 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-07-02 07:05:08 +0000
commita524524ac0ac2b4a6d64346d234d43a855a3e5a6 (patch)
tree8bcc87d0fb235255d67b75d73bfb2bab01c4eb30
parent907a68bcf17da27d7f76a0696654803c901779a4 (diff)
downloadmeson-a524524ac0ac2b4a6d64346d234d43a855a3e5a6.zip
meson-a524524ac0ac2b4a6d64346d234d43a855a3e5a6.tar.gz
meson-a524524ac0ac2b4a6d64346d234d43a855a3e5a6.tar.bz2
interpreter: Use is_subproject() everywhere
-rw-r--r--mesonbuild/interpreter.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 494cdb5..fc6588b 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1697,7 +1697,7 @@ class MesonMain(InterpreterObject):
@permittedKwargs({})
def is_unity_method(self, args, kwargs):
optval = self.interpreter.environment.coredata.get_builtin_option('unity')
- if optval == 'on' or (optval == 'subprojects' and self.interpreter.subproject != ''):
+ if optval == 'on' or (optval == 'subprojects' and self.interpreter.is_subproject()):
return True
return False
@@ -3605,7 +3605,7 @@ different subdirectory.
self.add_project_arguments(node, self.build.projects_link_args, args, kwargs)
def add_global_arguments(self, node, argsdict, args, kwargs):
- if self.subproject != '':
+ if self.is_subproject():
msg = 'Function \'{}\' cannot be used in subprojects because ' \
'there is no way to make that reliable.\nPlease only call ' \
'this if is_subproject() returns false. Alternatively, ' \
@@ -3710,7 +3710,7 @@ Try setting b_lundef to false instead.''')
(num_sps, sproj_name) = self.evaluate_subproject_info(norm, self.subproject_dir)
plain_filename = os.path.basename(norm)
if num_sps == 0:
- if self.subproject == '':
+ if not self.is_subproject():
return
raise InterpreterException('Sandbox violation: Tried to grab file %s from a different subproject.' % plain_filename)
if num_sps > 1: