In the Object Builder, use a single Action instance for all of the C++ file suffixes.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 10 Jan 2002 03:44:53 +0000 (03:44 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 10 Jan 2002 03:44:53 +0000 (03:44 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@195 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Defaults.py

index 2d2902821e036a68f53b6d0cb202f6e1040a1e15..8717bcff0fdfd4881efe8341ea1a1e19dcf9eeed 100644 (file)
@@ -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
index 2e11c3747210312a99dbdaed76e6428d9fb0ebba..5b985959afc7937a050631e24ac747d32c43c7c4 100644 (file)
@@ -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',