summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/CMakeLists.txt
blob: 7c78252f4c8d5572897df7f921681f45fc62e773 (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
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

#####################################################################
## QAndroidIntegrationPlugin Plugin:
#####################################################################
qt_find_package(EGL MODULE)

qt_internal_add_plugin(QAndroidIntegrationPlugin
    OUTPUT_NAME qtforandroid
    PLUGIN_TYPE platforms
    DEFAULT_IF "android" IN_LIST QT_QPA_PLATFORMS
    SOURCES
        androidcontentfileengine.cpp androidcontentfileengine.h
        qandroidapkfileengine.h qandroidapkfileengine.cpp
        androidjniinput.cpp androidjniinput.h
        androidjnimain.cpp androidjnimain.h
        androidjnimenu.cpp androidjnimenu.h
        main.cpp
        qandroidassetsfileenginehandler.cpp qandroidassetsfileenginehandler.h
        qandroideventdispatcher.cpp qandroideventdispatcher.h
        qandroidinputcontext.cpp qandroidinputcontext.h
        qandroidplatformdialoghelpers.cpp qandroidplatformdialoghelpers.h
        qandroidplatformfiledialoghelper.cpp qandroidplatformfiledialoghelper.h
        qandroidplatformfontdatabase.cpp qandroidplatformfontdatabase.h
        qandroidplatformforeignwindow.cpp qandroidplatformforeignwindow.h
        qandroidplatformfileiconengine.cpp qandroidplatformfileiconengine.h
        qandroidplatformiconengine.cpp qandroidplatformiconengine.h
        qandroidplatformintegration.cpp qandroidplatformintegration.h
        qandroidplatformmenu.cpp qandroidplatformmenu.h
        qandroidplatformmenubar.cpp qandroidplatformmenubar.h
        qandroidplatformmenuitem.cpp qandroidplatformmenuitem.h
        qandroidplatformscreen.cpp qandroidplatformscreen.h
        qandroidplatformservices.cpp qandroidplatformservices.h
        qandroidplatformtheme.cpp qandroidplatformtheme.h
        qandroidplatformwindow.cpp qandroidplatformwindow.h
        qandroidsystemlocale.cpp qandroidsystemlocale.h
        androidwindowembedding.cpp androidwindowembedding.h
        androidbackendregister.cpp androidbackendregister.h
    NO_UNITY_BUILD_SOURCES
        # Conflicting symbols and macros with androidjnimain.cpp
        # TODO: Unify the usage of FIND_AND_CHECK_CLASS, and similar
        #       macros. Q_JNI_FIND_AND_CHECK_CLASS in `qjnihelpers_p.h`
        #       seems to be doing most of the work already.
        androidjnimenu.cpp
        qandroidinputcontext.cpp
        qandroidplatformdialoghelpers.cpp
        # Conflicting JNI classes, and types
        androidcontentfileengine.cpp
        qandroidplatformforeignwindow.cpp
        qandroidplatformintegration.cpp
        qandroidplatformscreen.cpp
        qandroidplatformservices.cpp
        qandroidplatformwindow.cpp
        qandroidsystemlocale.cpp
    INCLUDE_DIRECTORIES
        ${CMAKE_CURRENT_SOURCE_DIR}
        ${QtBase_SOURCE_DIR}/src/3rdparty/android
    LIBRARIES
        Qt::Core
        Qt::CorePrivate
        Qt::Gui
        Qt::GuiPrivate
        android
        jnigraphics
)

## Scopes:
#####################################################################

qt_internal_extend_target(QAndroidIntegrationPlugin CONDITION QT_FEATURE_android_style_assets
    SOURCES
        extract.cpp
)

qt_internal_extend_target(QAndroidIntegrationPlugin CONDITION NOT QT_FEATURE_android_style_assets
    SOURCES
        extract-dummy.cpp
)

qt_internal_extend_target(QAndroidIntegrationPlugin CONDITION QT_FEATURE_clipboard
    SOURCES
        qandroidplatformclipboard.cpp qandroidplatformclipboard.h
)

qt_internal_extend_target(QAndroidIntegrationPlugin CONDITION QT_FEATURE_accessibility
    SOURCES
        androidjniaccessibility.cpp androidjniaccessibility.h
        qandroidplatformaccessibility.cpp qandroidplatformaccessibility.h
    NO_UNITY_BUILD_SOURCES
        androidjniaccessibility.cpp
)

qt_internal_extend_target(QAndroidIntegrationPlugin CONDITION QT_FEATURE_egl
    SOURCES
        qandroidplatformopenglcontext.cpp qandroidplatformopenglcontext.h
        qandroidplatformopenglwindow.cpp qandroidplatformopenglwindow.h
        qandroidplatformoffscreensurface.cpp qandroidplatformoffscreensurface.h
    LIBRARIES
        EGL::EGL
    NO_UNITY_BUILD_SOURCES
        qandroidplatformopenglcontext.cpp qandroidplatformopenglwindow.cpp
        qandroidplatformoffscreensurface.cpp
)

qt_internal_extend_target(QAndroidIntegrationPlugin CONDITION QT_FEATURE_vulkan
    SOURCES
        qandroidplatformvulkaninstance.cpp qandroidplatformvulkaninstance.h
        qandroidplatformvulkanwindow.cpp qandroidplatformvulkanwindow.h
    NO_UNITY_BUILD_SOURCES
        # To avoid undefined symbols due to missing VK_USE_PLATFORM_ANDROID_KHR
        qandroidplatformvulkaninstance.cpp qandroidplatformvulkanwindow.cpp
)