aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-01-15 02:01:21 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-01-15 19:45:23 +0200
commit58878b998d4a4a144c271edb2091904f05c0668c (patch)
tree68d4e79bdc3b011a08bd661eb9d65a519c4dfd14
parentdb8ad2a4bd4ed1e962e1cbfa76bd8abdf5e83b0e (diff)
downloadmeson-58878b998d4a4a144c271edb2091904f05c0668c.zip
meson-58878b998d4a4a144c271edb2091904f05c0668c.tar.gz
meson-58878b998d4a4a144c271edb2091904f05c0668c.tar.bz2
Get rid of hasattr.
-rw-r--r--mesonbuild/backend/ninjabackend.py4
-rw-r--r--mesonbuild/build.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index a051baf..e861bf7 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2163,9 +2163,7 @@ rule FORTRAN_DEP_HACK
def get_build_on_all_targets(self):
result = []
for t in self.build.get_targets().values():
- if t.build_on_all or \
- (hasattr(t, 'install') and t.install) or\
- (hasattr(t, 'build_always') and t.build_always):
+ if t.build_on_all or t.install or t.build_always:
result.append(t)
return result
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 555d0b9..b01c280 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -258,6 +258,8 @@ class Target:
self.name = name
self.subdir = subdir
self.build_on_all = build_on_all
+ self.install = False
+ self.build_always = False
def get_basename(self):
return self.name