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

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

qt_internal_add_plugin(QAndroidIntegrationPlugin
    OUTPUT_NAME qtforandroid
    PLUGIN_TYPE platforms
    DEFAULT_IF ${QT_QPA_DEFAULT_PLATFORM} MATCHES android
    SOURCES
        androidcontentfileengine.cpp androidcontentfileengine.h
        androiddeadlockprotector.h
        androidjniaccessibility.cpp androidjniaccessibility.h
        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
        qandroidplatformaccessibility.cpp qandroidplatformaccessibility.h
        qandroidplatformclipboard.cpp qandroidplatformclipboard.h
        qandroidplatformdialoghelpers.cpp qandroidplatformdialoghelpers.h
        qandroidplatformfiledialoghelper.cpp qandroidplatformfiledialoghelper.h
        qandroidplatformfontdatabase.cpp qandroidplatformfontdatabase.h
        qandroidplatformforeignwindow.cpp qandroidplatformforeignwindow.h
        qandroidplatformiconengine.cpp qandroidplatformiconengine.h
        qandroidplatformintegration.cpp qandroidplatformintegration.h
        qandroidplatformmenu.cpp qandroidplatformmenu.h
        qandroidplatformmenubar.cpp qandroidplatformmenubar.h
        qandroidplatformmenuitem.cpp qandroidplatformmenuitem.h
        qandroidplatformoffscreensurface.cpp qandroidplatformoffscreensurface.h
        qandroidplatformopenglcontext.cpp qandroidplatformopenglcontext.h
        qandroidplatformopenglwindow.cpp qandroidplatformopenglwindow.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
    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
        androidjniaccessibility.cpp
        qandroidplatformdialoghelpers.cpp
        # Conflicting JNI classes, and types
        androidcontentfileengine.cpp
        qandroidplatformintegration.cpp
    INCLUDE_DIRECTORIES
        ${CMAKE_CURRENT_SOURCE_DIR}
        ${QtBase_SOURCE_DIR}/src/3rdparty/android
    LIBRARIES
        EGL::EGL
        Qt::Core
        Qt::CorePrivate
        Qt::Gui
        Qt::GuiPrivate
        android
        jnigraphics
        EGL::EGL
)

## 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_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
)