File: precomp.test

package info (click to toggle)
qtbase-opensource-src 5.3.2%2Bdfsg-4%2Bdeb8u2
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 272,196 kB
  • ctags: 229,359
  • sloc: cpp: 1,623,111; ansic: 386,069; xml: 101,194; sh: 16,504; python: 9,156; java: 4,681; asm: 4,531; perl: 2,392; yacc: 1,926; lex: 970; makefile: 498; awk: 142; objc: 70; sed: 3
file content (54 lines) | stat: -rwxr-xr-x 1,151 bytes parent folder | download | duplicates (8)
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
45
46
47
48
49
50
51
52
53
54
#!/bin/sh

PRECOMP_SUPPORT=no
COMPILER=$1
VERBOSE=$2

case "$COMPILER" in
icpc)
    cat >header.h <<EOF
#define HEADER_H

EOF
    >header.cpp
    cat >source.cpp <<EOF
#ifndef HEADER_H
#error no go
#endif

EOF

    rm -f header.pchi
    $COMPILER -pch-create header.pchi -include header.h -c header.cpp -o header.o >/dev/null 2>&1 \
        && $COMPILER -pch-use header.pchi -include header.h -c source.cpp -o source.o >/dev/null 2>&1 \
        && PRECOMP_SUPPORT=yes

    rm -f header.h header.cpp source.cpp
    rm -f header.pchi header.o source.o
    ;;

*g++*|c++|*qcc*)
    case `"$COMPILER" -dumpversion 2>/dev/null` in
    3.*)
        ;;
    *)

        >precomp_header.h
        if $COMPILER -x c-header precomp_header.h >/dev/null 2>&1; then
           $COMPILER -x c++-header precomp_header.h && PRECOMP_SUPPORT=yes
        fi
        rm -f precomp_header.h precomp_header.h.gch
        ;;
    esac
    ;;
esac


# done
if [ "$PRECOMP_SUPPORT" != "yes" ]; then
    [ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support disabled."
    exit 0
else
    [ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support enabled."
    exit 1
fi