File: precompilespch

package info (click to toggle)
icmake 13.05.01-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,132 kB
  • sloc: cpp: 11,595; fortran: 883; makefile: 853; sh: 546; pascal: 342
file content (44 lines) | stat: -rw-r--r-- 1,322 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifdef IH
    string spchStr()            // join all SPCH -o option values and surround
    {                           // them by one set of single quotes
        string ret;
        for (int idx = 0, end = listlen(g_spch); idx != end; ++idx)
        {
            if (g_spch[idx] != "-o")
                ret += g_spch[idx] + ' ';
            else    // specify all following words as -o arguments
            {
                for (++idx; idx != end; ++idx)
                    ret += "-o " + g_spch[idx] + ' ';
                break;
            }
        }
        return ret;
    }
#ifdef USING_ARGS
    string tailArgs()
    {
        string ret;
        for (int idx = 1, end = listlen(g_spchArgs); idx != end; ++idx)
            ret += ' ' + g_spchArgs[idx];
        return ret;
    }
#endif
    void precompileSPCH()
    {
        string str = spchStr();         // surround all -o arguments by one 
                                        // pair of single quotes
#ifdef USING_ARGS
        system("icmake -S -a " + g_spchArgs[0] + " -i " + IH + ' ' + 
                str + "tmp/spch.gch" + tailArgs());
#else
        system("icmake -S -a " + g_spchArgs[0] + " -i " + IH + ' ' + 
                str + "tmp/spch.gch");
#endif
    }
#else
    void precompileSPCH()
    {
        requireIH("SPCH");
    }
#endif