summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/configure.prf
blob: ed6fe6c1570b93694f6cf8ccfda30c40d01ac920 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Load configure.prf from qtbase first
load(configure)
load(functions)
load(platform)

defineTest(runConfigure) {
    webengine_successfully_configured: return(true)

    !exists(src/3rdparty/chromium) {
        skipBuild("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.")
        return(false)
    }

    WSPC = $$find(OUT_PWD, \\s)
    !isEmpty(WSPC) {
        skipBuild("QtWebEngine cannot be built in a path that contains whitespace characters.")
        return(false)
    }

    !isPlatformSupported() {
        # make sure we have skipBuildReason
        isEmpty(skipBuildReason): skipBuild("Unknow error. Platform unspported")
        return(false)
    }

    linux:contains(QT_CONFIG,no-pkg-config) {
        skipBuild("pkg-config is required")
        return(false)
    }

    include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri)
    QT_FOR_CONFIG += webengine-private

    !qtConfig(gperf) {
        skipBuild("Required gperf could not be found.")
        return(false)
    }
    !qtConfig(bison) {
        skipBuild("Required bison could not be found.")
        return(false)
    }
    !qtConfig(flex) {
        skipBuild("Required flex could not be found.")
        return(false)
    }
    !qtConfig(python2) {
        skipBuild("A suitable version of python2 could not be found.")
        return(false)
    }

    qtConfig(pepper-plugins): WEBENGINE_CONFIG += use_pepper_plugins
    qtConfig(printing-and-pdf): WEBENGINE_CONFIG += use_printing use_pdf
    qtConfig(proprietary-codecs): WEBENGINE_CONFIG += use_proprietary_codecs
    qtConfig(spellchecker): WEBENGINE_CONFIG += use_spellchecker
    qtConfig(webrtc): WEBENGINE_CONFIG += use_webrtc
    qtConfig(embedded): WEBENGINE_CONFIG += embedded_build
    qtConfig(system-webp): WEBENGINE_CONFIG += use_system_libwebp
    qtConfig(system-opus): WEBENGINE_CONFIG += use_system_opus
    qtConfig(system-ffmpeg): WEBENGINE_CONFIG += use_system_ffmpeg
    qtConfig(system-icu): WEBENGINE_CONFIG += use_system_icu
    qtConfig(system-re2): WEBENGINE_CONFIG += use_system_re2

    !contains(WEBENGINE_CONFIG, use_system_libwebp): WEBENGINE_CONFIG += use_bundled_libwebp
    !contains(WEBENGINE_CONFIG, use_system_opus): WEBENGINE_CONFIG += use_bundled_opus
    !contains(WEBENGINE_CONFIG, use_system_ffmpeg): WEBENGINE_CONFIG += use_bundled_ffmpeg
    !contains(WEBENGINE_CONFIG, use_system_icu): WEBENGINE_CONFIG += use_bundled_icu

    qtConfig(appstore-compliant): WEBENGINE_CONFIG += use_appstore_compliant_code
    optimize_size: WEBENGINE_CONFIG += reduce_binary_size

    sanitizer: !qtConfig(webengine-sanitizer) {
        skipBuild("Chosen sanitizer configuration is not supported. Use --feature-webengine-sanitizer=yes to force build with the chosen sanitizer configuration.")
        return(false);
    }

    linux {
        !qtConfig(system-glibc) {
            skipBuild("A suitable version of libc could not be found. See: https://sourceware.org/bugzilla/show_bug.cgi?id=14898")
            return(false)
        }

        QT_FOR_CONFIG += gui-private

        !qtConfig(system-khr) {
            skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)")
            return(false)
        }

        for(package, $$list("nss dbus fontconfig")) {
            !qtConfig(system-$$package) {
                skipBuild("A suitable version of $$package could not be found.")
                return(false)
            }
         }

        WEBENGINE_CONFIG += use_nss

        !contains(WEBENGINE_CONFIG, embedded_build): qtConfig(xcb) {
             for(package, $$list("libdrm xcomposite xcursor xi xrandr xtst")) {
                 !qtConfig(system-$$package) {
                     skipBuild("A suitable version of $$package could not be found.")
                     return(false)
                 }
             }
        }

        # Fix me: mamke system-png a public feature in gui
        qtConfig(system-png): qtConfig(webengine-system-png) {
             WEBENGINE_CONFIG += use_system_libpng
        }
        # Fix me: make system-harfbuzz a public feautre in gui
        qtConfig(system-harfbuzz): qtConfig(webengine-system-harfbuzz) {
             WEBENGINE_CONFIG += use_system_harfbuzz
        }
        qtConfig(system-glib) {
             WEBENGINE_CONFIG += use_glib
        }
        qtConfig(system-minizip) {
             WEBENGINE_CONFIG += use_system_minizip
        }
        qtConfig(system-zlib) {
             WEBENGINE_CONFIG += use_system_zlib
        }
        qtConfig(system-libxml2) {
            WEBENGINE_CONFIG += use_system_libxslt use_system_libxml2
        }

        for(package, $$list("libevent jsoncpp protobuf libvpx libsrtp snappy")) {
            qtConfig(system-$$package) {
                WEBENGINE_CONFIG += use_system_$$package
            } else {
                WEBENGINE_CONFIG += use_bundled_$$package
            }
        }
    }

    isEmpty(skipBuildReason) {
        cache(CONFIG, add, $$list(webengine_successfully_configured))
        !isEmpty(WEBENGINE_CONFIG) {
            cache(WEBENGINE_CONFIG, add, $$list($$WEBENGINE_CONFIG))
            export(WEBENGINE_CONFIG)
        }
    }

    macos:qtConfig(native-spellchecker) {
        WEBENGINE_CONFIG+=use_native_spellchecker
    }
}