- 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
import os
+import SCons.Action
import SCons.Builder
import SCons.Scanner.C
import SCons.Scanner.Prog
},
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',