summaryrefslogtreecommitdiff
path: root/subprojects/packagefiles/vndk/meson.build
blob: ca39192ec24bc0a08cde3057b08e10cbe7b8c006 (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
# SPDX-License-Identifier: CC0-1.0

project('vndk', 'cpp',
        version : 'vndk-v34')

cpu_family = host_machine.cpu_family()
if cpu_family == 'x86_64'
  cpu = 'x86_64'
  prebuilt_path = cpu / 'arch-x86_64/shared'
elif cpu_family == 'aarch64'
  cpu = 'arm64'
  prebuilt_path = cpu / 'arch-arm64-armv8-a/shared'
else
    error('Architecture:  ' + cpu_family + ' not supported')
endif

prebuild_libraries = [
    meson.current_source_dir() / prebuilt_path / 'llndk-stub',
    meson.current_source_dir() / prebuilt_path / 'vndk-sp',
    meson.current_source_dir() / prebuilt_path / 'vndk-core',
]

include_base = cpu / 'include'

cxx = meson.get_compiler('cpp')
libhardware_dep = declare_dependency(
    dependencies : cxx.find_library('hardware', dirs : prebuild_libraries),
    include_directories : include_directories(include_base / 'hardware/libhardware/'))
meson.override_dependency('libhardware', libhardware_dep)

liblog_dep = declare_dependency(
    dependencies : cxx.find_library('log', dirs : prebuild_libraries),
    include_directories : include_directories(include_base / 'system/logging/liblog/include_vndk'))
meson.override_dependency('liblog', liblog_dep)

libutils_dep = declare_dependency(
    dependencies : [
        cxx.find_library('utils', dirs : prebuild_libraries),
        liblog_dep,
    ],
    include_directories : include_directories(include_base / 'system/core/libutils/include'))
meson.override_dependency('libutils', libutils_dep)

libui_dep = declare_dependency(
    dependencies : [
        cxx.find_library('ui', dirs : prebuild_libraries),
        libutils_dep,
    ],
    include_directories : include_directories(include_base / 'frameworks/native/libs/ui/include_vndk'))
meson.override_dependency('libui', libui_dep)

vndk_libcpp_dep = declare_dependency(
    dependencies : [
        cxx.find_library('c++', dirs : prebuild_libraries),
        cxx.find_library('c', dirs : prebuild_libraries),
    ],
    include_directories : [
        include_directories(include_base / 'external/libcxx/include'),
        include_directories(include_base / 'external/libcxxabi/include'),
    ])
meson.override_dependency('cpp_stdlib', vndk_libcpp_dep)

libexif_dep = declare_dependency(
    dependencies : [
        cxx.find_library('exif', dirs : prebuild_libraries),
        libutils_dep,
    ],
    include_directories : include_directories(include_base / 'external/libexif/'))
meson.override_dependency('libexif', libexif_dep)

libjpeg_dep = declare_dependency(
    dependencies : [
        cxx.find_library('jpeg', dirs : prebuild_libraries),
        libutils_dep,
    ],
    include_directories : include_directories(include_base / 'external/libjpeg-turbo/'))
meson.override_dependency('libjpeg', libjpeg_dep)

vndk_libyuv_dep = declare_dependency(
    dependencies : [
        cxx.find_library('yuv', dirs : prebuild_libraries),
        libutils_dep,
    ],
    include_directories : include_directories(include_base / 'external/libyuv/files/include'))
meson.override_dependency('vndk_libyuv', vndk_libyuv_dep)

vndk_libssl_dep = declare_dependency(
    dependencies : [
        cxx.find_library('crypto', dirs : prebuild_libraries),
        libutils_dep,
    ],
    include_directories : include_directories(include_base / 'external/boringssl/src/include'))
meson.override_dependency('libcrypto', vndk_libssl_dep)