summaryrefslogtreecommitdiff
path: root/src/buildstream/element.py
diff options
context:
space:
mode:
authorTristan van Berkom <tristan@codethink.co.uk>2020-09-02 18:47:46 +0900
committerTristan van Berkom <tristan@codethink.co.uk>2020-09-18 12:38:49 +0900
commit247aad32d3046068c793463190fbd3248379f096 (patch)
tree2cdc6169999aa18cefd87331bc924baf3d2ea75c /src/buildstream/element.py
parent7320a6f58b7542deb2b0c3f27e387fabf6b8d8e7 (diff)
downloadbuildstream-247aad32d3046068c793463190fbd3248379f096.tar.gz
_loader: Added DependencyType
This is a bit nicer than relying on strings in the Symbol enumeration, and allows for some bitwise operations so we can test for BUILD or RUNTIME.
Diffstat (limited to 'src/buildstream/element.py')
-rw-r--r--src/buildstream/element.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index be65b26ca..08dd69fff 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -107,7 +107,7 @@ from .types import _Scope, _CacheBuildTrees, _KeyStrength, OverlapAction
from ._artifact import Artifact
from ._elementproxy import ElementProxy
from ._elementsources import ElementSources
-from ._loader import Symbol, MetaSource
+from ._loader import Symbol, DependencyType, MetaSource
from ._overlapcollector import OverlapCollector
from .storage.directory import Directory
@@ -1038,11 +1038,11 @@ class Element(Plugin):
for dep in load_element.dependencies:
dependency = Element._new_from_load_element(dep.element, task)
- if dep.dep_type != "runtime":
+ if dep.dep_type & DependencyType.BUILD:
element.__build_dependencies.append(dependency)
dependency.__reverse_build_deps.add(element)
- if dep.dep_type != "build":
+ if dep.dep_type & DependencyType.RUNTIME:
element.__runtime_dependencies.append(dependency)
dependency.__reverse_runtime_deps.add(element)