summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Node')
-rw-r--r--src/engine/SCons/Node/FSTests.py1
-rw-r--r--src/engine/SCons/Node/NodeTests.py2
-rw-r--r--src/engine/SCons/Node/__init__.py21
3 files changed, 12 insertions, 12 deletions
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 1a3236e..5018f99 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -94,6 +94,7 @@ class Builder:
self.overrides = {}
self.action = action
self.target_scanner = None
+ self.source_scanner = None
def targets(self, t):
return [t]
diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py
index 7d737be..4424e61 100644
--- a/src/engine/SCons/Node/NodeTests.py
+++ b/src/engine/SCons/Node/NodeTests.py
@@ -128,6 +128,8 @@ class Builder:
self.action = MyAction()
self.source_factory = MyNode
self.is_explicit = is_explicit
+ self.target_scanner = None
+ self.source_scanner = None
def targets(self, t):
return [t]
def get_actions(self):
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py
index 06cb5bf..93a6537 100644
--- a/src/engine/SCons/Node/__init__.py
+++ b/src/engine/SCons/Node/__init__.py
@@ -467,6 +467,13 @@ class Node:
scanner = scanner.select(node)
return scanner
+ def add_to_implicit(self, deps):
+ if not hasattr(self, 'implicit') or self.implicit is None:
+ self.implicit = []
+ self.implicit_dict = {}
+ self._children_reset()
+ self._add_child(self.implicit, self.implicit_dict, deps)
+
def scan(self):
"""Scan this node's dependents for implicit dependencies."""
# Don't bother scanning non-derived files, because we don't
@@ -500,18 +507,8 @@ class Node:
self._children_reset()
self.del_binfo()
- # Potential optimization for the N^2 problem if we can tie
- # scanning to the Executor in some way so that we can scan
- # source files onces and then spread the implicit dependencies
- # to all of the targets at once.
- #kids = self.children(scan=0)
- #for child in filter(lambda n: n.implicit is None, kids):
- for child in self.children(scan=0):
- scanner = self.get_source_scanner(child)
- if scanner:
- path = self.get_build_scanner_path(scanner)
- deps = child.get_implicit_deps(build_env, scanner, path)
- self._add_child(self.implicit, self.implicit_dict, deps)
+ scanner = self.builder.source_scanner
+ self.get_executor().scan(scanner)
# scan this node itself for implicit dependencies
scanner = self.builder.target_scanner