From adcbb1772534c26d8c7ad45b505e0bc61bac63be Mon Sep 17 00:00:00 2001 From: stevenknight Date: Thu, 10 Jan 2002 03:44:53 +0000 Subject: [PATCH] In the Object Builder, use a single Action instance for all of the C++ file suffixes. git-svn-id: http://scons.tigris.org/svn/scons/trunk@195 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 3 +++ src/engine/SCons/Defaults.py | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 2d290282..8717bcff 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -42,6 +42,9 @@ RELEASE 0.03 - - Put the Action factory and classes into their own module. + - Use one CPlusPlusAction in the Object Builder's action dictionary, + instead of letting it create multiple identical instances. + From Anthony Roach: - Add a "duplicate" keyword argument to BuildDir() that can be set diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py index 2e11c374..5b985959 100644 --- a/src/engine/SCons/Defaults.py +++ b/src/engine/SCons/Defaults.py @@ -37,6 +37,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os +import SCons.Action import SCons.Builder import SCons.Scanner.C import SCons.Scanner.Prog @@ -49,14 +50,16 @@ CFile = SCons.Builder.Builder(name = 'CFile', }, suffix = '.c') +CPlusPlusAction = SCons.Action.Action('$CXXCOM') + Object = SCons.Builder.Builder(name = 'Object', action = { '.c' : '$CCCOM', - '.C' : '$CXXCOM', - '.cc' : '$CXXCOM', - '.cpp' : '$CXXCOM', - '.cxx' : '$CXXCOM', - '.c++' : '$CXXCOM', - '.C++' : '$CXXCOM', + '.C' : CPlusPlusAction, + '.cc' : CPlusPlusAction, + '.cpp' : CPlusPlusAction, + '.cxx' : CPlusPlusAction, + '.c++' : CPlusPlusAction, + '.C++' : CPlusPlusAction, }, prefix = '$OBJPREFIX', suffix = '$OBJSUFFIX', -- 2.26.2