summaryrefslogtreecommitdiffstats
path: root/src/buildtools/config/support.pri
blob: 7c1262f855c8c21545b4612fce71dacc3ba1970f (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
defineTest(qtwebengine_skipBuild) {
    isEmpty(skipBuildReason): skipBuildReason = $$1
    else: skipBuildReason = "$$skipBuildReason $${EOL}$$1"
    export(skipBuildReason)
}

defineReplace(qtwebengine_checkError) {

    static {
       qtwebengine_skipBuild("Static builds of QtWebEngine are not supported.")
       return(false)
    }

    !qtHaveModule(gui) {
        qtwebengine_skipBuild("QtWebEngine requires QtGui.")
        return(false)
    }

    !qtConfig(webengine-submodule) {
        qtwebengine_skipBuild("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.")
        return(false)
    }

    !qtConfig(webengine-nowhitespace) {
        qtwebengine_skipBuild("QtWebEngine cannot be built in a path that contains whitespace characters.")
        return(false)
    }

    qtConfig(webengine-no-platform-support) {
        !isEmpty(platformError) {
            qtwebengine_skipBuild($$platformError)
            return(false)
        }
        !isEmpty(QTWEBENGINE_OUT_ROOT) {
            include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
            QT_FOR_CONFIG += buildtools-private
            qtwebengine_skipBuild($$PLATFORM_ERROR)
            return(false)
        }
        qtwebengine_skipBuild("QtWebEngine will not be built. Platform unsupported.") # re-run of configure when topLevel build
        return(false):
    }

    !qtConfig(webengine-arch-support) {
        qtwebengine_skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
        return(false)
    }

    !qtConfig(webengine-gperf) {
        qtwebengine_skipBuild("Tool gperf is required to build QtWebEngine.")
        return(false)
    }

    !qtConfig(webengine-bison) {
        qtwebengine_skipBuild("Tool bison is required to build QtWebEngine.")
        return(false)
    }

    !qtConfig(webengine-flex) {
        qtwebengine_skipBuild("Tool flex is required to build QtWebEngine.")
        return(false)
    }

    !qtConfig(webengine-python2) {
        qtwebengine_skipBuild("Python version 2 (2.7.5 or later) is required to build QtWebEngine.")
        return(false)
    }

    linux:!qtwebengine_checkErrorForLinux():return(false)
    win:!qtwebengine_checkErrorForWindows():return(false)

    sanitizer: !qtConfig(webengine-sanitizer) {
        qtwebengine_skipBuild("Chosen sanitizer configuration is not supported. Check config.log for details or use -feature-webengine-sanitizer to force build with the chosen sanitizer configuration.")
        return(false);
    }

    return(true)
}

defineTest(qtwebengine_checkErrorForLinux) {

    !qtConfig(pkg-config) {
        qtwebengine_skipBuild("A pkg-config support is required.")
        return(false)
    }

    !qtConfig(webengine-host-pkg-config) {
        qtwebengine_skipBuild("Host pkg-config is required")
        return(false)
    }

    !qtConfig(webengine-system-glibc) {
        qtwebengine_skipBuild("A suitable version >= 2.27 of libc could not be found.")
        return(false)
    }

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

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

    qtConfig(pkg-config):qtConfig(xcb):!qtConfig(webengine-ozone-x11) {
        qtwebengine_skipBuild("Could not find all necessary libraries for qpa-xcb support")
        return(false)
    }
    return(true)
}

defineTest(qtwebengine_checkErrorForWindows) {
    !qtConfig(webengine-win-compiler64) {
        qtwebengine_skipBuild("Required 64-bit cross-building or native toolchain could not be found.")
        return(false)
    }

    !qtConfig(webengine-winversion) {
        qtwebengine_skipBuild("Needs Visual Studio 2017 or higher")
        return(false)
    }
    return(true)
}

defineTest(qtwebengine_makeCheckError) {
    include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
    QT_FOR_CONFIG += buildtools-private gui-private
    return($$qtwebengine_checkError())
}