summaryrefslogtreecommitdiff
path: root/Tools/qmake/mkspecs/features/webkit_modules.prf
blob: b2f3353648d708fb162b59150601b3cafdf59ad2 (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
# -------------------------------------------------------------------
# Used for applying the content of the WEBKIT variable into the
# effect each library/module has on variables such as LIBS and QT.
#
# See 'Tools/qmake/README' for an overview of the build system
# -------------------------------------------------------------------

# Reorder libraries so that the link and include order is correct,
# and make sure the case matches the original case.
libraries = WebKit1 WebKit2 WebCore ANGLE JavaScriptCore WTF
for(library, libraries) {
    contains(WEBKIT, $$lower($$library)) {
        WEBKIT -= $$lower($$library)
        WEBKIT *= $$library
    }
}

# Load the .pri file for each library, to pick up LIBS, INCLUDES,
# and other dependencies the library adds.
for(library, WEBKIT) {
    # Juggle LIBS to keep the static link order correct
    existing_libs = $$LIBS
    unset(LIBS)

    # We definitly need include paths and such (this will set
    # SOURCE_DIR to the right path so we can use it below).
    library_identifier = $$lower($$library)
    include(../modules/$${library_identifier}.prf)

    # More juggling, so that we can add the dependent libs later
    # on if we decide that we need to link to the library.
    eval(WEBKIT.$${library_identifier}.dependent_libs = $$LIBS)
    LIBS = $$existing_libs

    # Anything not linking dynamically to QtWebKit should make sure to have its export
    # macros synchronized with the code that it will be linked with statically.
    !contains(QT, webkitwidgets): DEFINES += STATICALLY_LINKED_WITH_$$library
}

!isEmpty(MODULE): CONFIG += creating_module

creating_module {
    # Sanitize PKGCONFIG as we don't want any of these libraries
    # to end up in as public API dependenices in the QtWebKit prl file.
    PKGCONFIG_PRIVATE *= $$PKGCONFIG
    unset(PKGCONFIG)

    # We do have a limited subset of Qt modules as dependencies for using
    # the public QtWebKit API. The rest of the modules go into QT_PRIVATE.
    QT_PRIVATE *= $$QT
    QT = $$QT_API_DEPENDS
    QT_PRIVATE -= $$QT
}