diff options
-rw-r--r-- | SCons/SConf.py | 3 | ||||
-rw-r--r-- | SCons/Tool/ninja/Methods.py | 5 | ||||
-rw-r--r-- | SCons/Tool/ninja/NinjaState.py | 2 | ||||
-rw-r--r-- | SCons/Tool/ninja/Utils.py | 7 | ||||
-rw-r--r-- | SCons/Tool/ninja/__init__.py | 2 |
5 files changed, 10 insertions, 9 deletions
diff --git a/SCons/SConf.py b/SCons/SConf.py index 68e890a..38a2b94 100644 --- a/SCons/SConf.py +++ b/SCons/SConf.py @@ -606,7 +606,7 @@ class SConfBase: f = "_".join([f, textSig, textSigCounter]) textFile = self.confdir.File(f + extension) - self._set_conftest_node(sourcetext) + self._set_conftest_node(textFile) textFileNode = self.env.SConfSourceBuilder(target=textFile, source=sourcetext) nodesToBeBuilt.extend(textFileNode) @@ -625,6 +625,7 @@ class SConfBase: pref = self.env.subst( builder.builder.prefix ) suff = self.env.subst( builder.builder.suffix ) target = self.confdir.File(pref + f + suff) + self._set_conftest_node(target) try: # Slide our wrapper into the construction environment as diff --git a/SCons/Tool/ninja/Methods.py b/SCons/Tool/ninja/Methods.py index 3612236..6f24dff 100644 --- a/SCons/Tool/ninja/Methods.py +++ b/SCons/Tool/ninja/Methods.py @@ -77,10 +77,9 @@ def set_build_node_callback(env, node, callback): def get_generic_shell_command(env, node, action, targets, sources, executor=None): return ( - "CMD", + "GENERATED_CMD", { - # TODO: Why is executor passed in and then ignored below? (bdbaddog) - "cmd": generate_command(env, node, action, targets, sources, executor=None), + "cmd": generate_command(env, node, action, targets, sources, executor=executor), "env": get_command_env(env), }, # Since this function is a rule mapping provider, it must return a list of dependencies, diff --git a/SCons/Tool/ninja/NinjaState.py b/SCons/Tool/ninja/NinjaState.py index 14704eb..e834d61 100644 --- a/SCons/Tool/ninja/NinjaState.py +++ b/SCons/Tool/ninja/NinjaState.py @@ -95,7 +95,7 @@ class NinjaState: [escape(arg) for arg in sys.argv if arg not in COMMAND_LINE_TARGETS] ), ), - "SCONS_INVOCATION_W_TARGETS": "{} {} --disable-ninja".format( + "SCONS_INVOCATION_W_TARGETS": "{} {}".format( python_bin, " ".join([escape(arg) for arg in sys.argv]) ), # This must be set to a global default per: diff --git a/SCons/Tool/ninja/Utils.py b/SCons/Tool/ninja/Utils.py index 18d54dc..fba5a63 100644 --- a/SCons/Tool/ninja/Utils.py +++ b/SCons/Tool/ninja/Utils.py @@ -64,10 +64,9 @@ def is_valid_dependent_node(node): if isinstance(node, SCons.Node.Alias.Alias): return node.children() - if not node.env: - return True + return not node.get_env().get("NINJA_SKIP") + - return not node.env.get("NINJA_SKIP") def alias_to_ninja_build(node): @@ -88,7 +87,7 @@ def check_invalid_ninja_node(node): def filter_ninja_nodes(node_list): ninja_nodes = [] for node in node_list: - if isinstance(node, (SCons.Node.FS.Base, SCons.Node.Alias.Alias)): + if isinstance(node, (SCons.Node.FS.Base, SCons.Node.Alias.Alias)) and not node.get_env().get('NINJA_SKIP'): ninja_nodes.append(node) else: continue diff --git a/SCons/Tool/ninja/__init__.py b/SCons/Tool/ninja/__init__.py index 8207b15..e346e7d 100644 --- a/SCons/Tool/ninja/__init__.py +++ b/SCons/Tool/ninja/__init__.py @@ -417,6 +417,8 @@ def generate(env): def ninja_execute(self): target = self.targets[0] + if target.get_env().get('NINJA_SKIP'): + return if target.check_attributes('ninja_file') is None or not target.is_conftest: NINJA_STATE.add_build(target) else: |