From 78e5ce0c8fa9a7fcc1376fd554565bd80f089815 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Thu, 26 May 2022 00:46:12 -0500 Subject: small optimizations --- SCons/SConf.py | 9 ++++----- test/Configure/conftest_source_file.py | 12 ++++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/SCons/SConf.py b/SCons/SConf.py index dc7ec17..224bf5a 100644 --- a/SCons/SConf.py +++ b/SCons/SConf.py @@ -227,7 +227,7 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask): This is almost the same as SCons.Script.BuildTask. Handles SConfErrors correctly and knows about the current cache_mode. """ - sconf_nodes = set() + non_sconf_nodes = set() def display(self, message): if sconf_global.logstream: @@ -379,14 +379,13 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask): sconsign.merge() def make_ready_current(self): - self.sconf_nodes.update(self.targets) + self.non_sconf_nodes.update([t for t in self.targets if not t.is_conftest()]) super().make_ready_current() make_ready = make_ready_current def postprocess(self): - for node in self.sconf_nodes: - if not node.is_conftest(): - node.ninfo = node.new_ninfo() + for node in self.non_sconf_nodes: + node.ninfo = node.new_ninfo() super().postprocess() class SConfBase: diff --git a/test/Configure/conftest_source_file.py b/test/Configure/conftest_source_file.py index c5c593e..2e3598c 100644 --- a/test/Configure/conftest_source_file.py +++ b/test/Configure/conftest_source_file.py @@ -39,22 +39,22 @@ test.dir_fixture("conftest_source_file") test.run(arguments='.') conf_text = textwrap.dedent("""\ - Checking for C header file header1.h... {cached1}yes - Checking for C header file header3.h... {cached3}yes + Checking for C header file header1.h... {}yes + Checking for C header file header3.h... (cached) yes """) -test.up_to_date(read_str=conf_text.format(cached1='(cached) ', cached3='(cached) ')) +test.up_to_date(read_str=conf_text.format('(cached) ')) test.write('header2.h', """ #pragma once int test_header = 2; """) -test.not_up_to_date(read_str=conf_text.format(cached1='(cached) ', cached3='(cached) ')) +test.not_up_to_date(read_str=conf_text.format('(cached) ')) -test.up_to_date(read_str=conf_text.format(cached1='', cached3='(cached) ')) +test.up_to_date(read_str=conf_text.format('')) -test.up_to_date(read_str=conf_text.format(cached1='(cached) ', cached3='(cached) ')) +test.up_to_date(read_str=conf_text.format('(cached) ')) test.pass_test() -- cgit v0.12