File: setgcompiler

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 (31 lines) | stat: -rw-r--r-- 847 bytes parent folder | download | duplicates (2)
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
void setGcompiler()
{
    // try a C++ compiler; if not found: try a C compiler; if not found
    // try COMPILER. 
    // Same for matching options.

#ifdef CXX
    list envOpts = getenv("ICMAKE_CPPSTD");
    if (envOpts[0] == "0")
    {
        envOpts =  getenv("ICMAKE_CXXFLAGS");
        if (envOpts[1])
            printf << "ICMAKE_CXXFLAGS is deprecated. "
                        "Use ICMAKE_CPPSTD instead\n";
    }
    g_compiler = setOpt(CXX, "CXX") + ' ' + 
                    envOpts[1] + ' ' + setOpt(CXXFLAGS, "CXXFLAGS");
#else
    #ifdef CC
        g_compiler = setOpt(CC, "CC") + " " + setOpt(CFLAGS, "CFLAGS");
    #else
        #ifdef COMPILER

            #ifdef COMPILER_OPTIONS
                g_compiler = COMPILER + " " + COMPILER_OPTIONS;
            #endif

        #endif // COMPILER
    #endif // CC
#endif // CXX
}