-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
80 lines (69 loc) · 2.58 KB
/
meson.build
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
project('AOSP system core', 'c', 'cpp', default_options : ['cpp_std=c++17'])
fs = import('fs')
#--------------------------------------------------
# costants
#--------------------------------------------------
jni_root = 'jni/'
java_headers = [
fs.expanduser('~/.sdkman/candidates/java/current/include'),
fs.expanduser('~/.sdkman/candidates/java/current/include/linux'),
]
external_aosp_root = fs.expanduser('~/android/a')
loose_deps_lib_dir = meson.source_root()+ '/system_core/build'
loose_deps_header_dir = external_aosp_root + '/system/core/libutils/include'
liblog_so_dep = meson.get_compiler('cpp').find_library('log', dirs: loose_deps_lib_dir, required: true)
libbase_so_dep = meson.get_compiler('cpp').find_library('base', dirs: loose_deps_lib_dir, required: true)
#--------------------------------------------------
# libsystem_clock_so
#--------------------------------------------------
libsystem_clock_sources = [
jni_root + 'android_os_SystemClock_Companion.cpp',
]
# deps 1
loose_deps = declare_dependency(
link_args : ['-L' + loose_deps_lib_dir, '-l' + 'utils'],
include_directories : include_directories(loose_deps_header_dir))
# deps 2
libsystem_clock_deps = meson.get_compiler('cpp').find_library('utils', dirs: loose_deps_lib_dir, required: true)
libsystem_clock_so = library(
'system_clock',
libsystem_clock_sources,
include_directories: [
jni_root + 'include',
external_aosp_root + '/system/core/include',
] + java_headers,
#dependencies : [loose_deps],
dependencies : [libsystem_clock_deps],
)
#--------------------------------------------------
# libalarm_manager.so
#--------------------------------------------------
libalarm_manager_sources = [
jni_root + 'com_android_server_AlarmManagerService_Companion.cpp',
]
libalarm_manager_so = library(
'alarm_manager',
libalarm_manager_sources,
include_directories: [
jni_root + 'include',
external_aosp_root + '/system/core/include',
] + java_headers,
cpp_args : ['-Wno-writable-strings'],
dependencies : [libsystem_clock_deps, liblog_so_dep],
)
#--------------------------------------------------
# libcfig_ahelper.so
#--------------------------------------------------
libcfig_ahelper_sources = [
jni_root + 'cfig_AHelper_Companion.cpp',
]
libcfig_ahelper_so = library(
'cfig_ahelper',
libcfig_ahelper_sources,
include_directories: [
jni_root + 'include',
external_aosp_root + '/system/core/base/include',
] + java_headers,
cpp_args : ['-Wno-writable-strings'],
dependencies : [libbase_so_dep],
)