~ubuntu-branches/ubuntu/wily/bombono-dvd/wily

« back to all changes in this revision

Viewing changes to tools/scripts/gch.py

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-03-12 08:42:05 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100312084205-kugmzrqqv7zm3k7n
Tags: upstream-0.5.5
ImportĀ upstreamĀ versionĀ 0.5.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
if BuildVars.IsSConsGE_0_96_92(def_env):
47
47
    GchAction = SCons.Action.Action('$GCHCOM', '$GCHCOMSTR')
48
48
    GchShAction = SCons.Action.Action('$GCHSHCOM', '$GCHSHCOMSTR')
 
49
    
 
50
    # compose gch string from standard one, adding -x c++-header after '-o ' option
 
51
    import re
 
52
    pat = re.compile(re.escape("$TARGET "))
 
53
    def MakeGchString(cmd_str):
 
54
        res = re.subn(pat, "$TARGET -x c++-header ", cmd_str)
 
55
        assert res[1] == 1
 
56
        return res[0]
49
57
 
50
58
    GetCScannerFunc = lambda : SCons.Scanner.C.CScanner()
51
 
    GCHCOMString    = '$CXX -o $TARGET -x c++-header -c $CXXFLAGS $_CCCOMCOM $SOURCE'
52
 
    GCHSHCOMString  = '$CXX -o $TARGET -x c++-header -c $SHCXXFLAGS $_CCCOMCOM $SOURCE'
 
59
    GCHCOMString    = MakeGchString(def_env['CXXCOM'])   # '$CXX -o $TARGET -x c++-header -c $CXXFLAGS $_CCCOMCOM $SOURCE'
 
60
    GCHSHCOMString  = MakeGchString(def_env['SHCXXCOM']) # '$CXX -o $TARGET -x c++-header -c $SHCXXFLAGS $_CCCOMCOM $SOURCE'
53
61
else:
54
62
    # < 0.96.92
55
63
    GchAction = SCons.Action.Action('$GCHCOM')