-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD.gn
170 lines (155 loc) · 3.59 KB
/
BUILD.gn
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//common-mk/generate-dbus-adaptors.gni")
import("//common-mk/pkg_config.gni")
import("//common-mk/proto_library.gni")
group("all") {
deps = [
":imageloader",
":imageloader-adaptors",
":libimageloader_static",
":protos",
]
if (use.test) {
deps += [ ":run_tests" ]
}
if (use.fuzzer) {
deps += [
":imageloader_helper_process_receiver_fuzzer",
":imageloader_manifest_fuzzer",
]
}
}
pkg_config("target_defaults") {
pkg_deps = [
"devmapper",
"libbrillo",
"libchrome",
"libcrypto",
"libminijail",
]
if (use.fuzzer) {
# Link against protobuf for fuzzers so we can use libprotobuf-mutator.
pkg_deps += [ "protobuf" ]
} else {
pkg_deps += [ "protobuf-lite" ]
}
}
proto_library("protos") {
proto_in_dir = "."
proto_out_dir = "include/imageloader"
sources = [ "${proto_in_dir}/ipc.proto" ]
if (use.fuzzer) {
# Override optimize_for option in proto file.
gen_cpp_mode = "speed"
}
}
generate_dbus_adaptors("imageloader-adaptors") {
dbus_adaptors_out_dir = "include/imageloader/dbus_adaptors"
dbus_service_config = "dbus_adaptors/dbus-service-config.json"
sources = [ "dbus_adaptors/org.chromium.ImageLoaderInterface.xml" ]
}
shared_library("libimageloader-manifest") {
configs += [ ":target_defaults" ]
sources = [
"manifest.cc",
"manifest.h",
]
}
static_library("libimageloader_static") {
configs += [ ":target_defaults" ]
deps = [
":imageloader-adaptors",
":libimageloader-manifest",
":protos",
]
sources = [
"component.cc",
"component.h",
"dlc.cc",
"dlc.h",
"helper_process_proxy.cc",
"helper_process_proxy.h",
"helper_process_receiver.cc",
"helper_process_receiver.h",
"imageloader.cc",
"imageloader.h",
"imageloader_impl.cc",
"verity_mounter.cc",
"verity_mounter.h",
"verity_mounter_impl.cc",
"verity_mounter_impl.h",
]
}
pkg_config("imageloader_config") {
pkg_deps = [ "libbrillo" ]
}
executable("imageloader") {
configs += [
":target_defaults",
":imageloader_config",
]
deps = [
":imageloader-adaptors",
":libimageloader_static",
]
sources = [
"imageloader.h",
"imageloader_main.cc",
]
}
if (use.test) {
pkg_config("run_tests_config") {
pkg_deps = [
"libbrillo",
"libcrypto",
]
}
executable("run_tests") {
configs += [
"//common-mk:test",
":run_tests_config",
":target_defaults",
]
deps = [
":libimageloader_static",
"//common-mk/testrunner:testrunner",
]
sources = [
"component.h",
"component_test.cc",
"dlc_test.cc",
"imageloader.cc",
"imageloader.h",
"imageloader_test.cc",
"manifest_test.cc",
"mock_helper_process_proxy.h",
"test_utilities.cc",
"test_utilities.h",
"verity_mounter_test.cc",
]
}
}
if (use.fuzzer) {
pkg_config("run_fuzzer_config") {
pkg_deps = [ "libprotobuf-mutator" ]
}
executable("imageloader_helper_process_receiver_fuzzer") {
configs += [
"//common-mk/common_fuzzer:common_fuzzer",
":run_fuzzer_config",
":target_defaults",
]
deps = [ ":libimageloader_static" ]
sources = [ "helper_process_receiver_fuzzer.cc" ]
}
executable("imageloader_manifest_fuzzer") {
configs += [
"//common-mk/common_fuzzer",
":target_defaults",
]
deps = [ ":libimageloader_static" ]
sources = [ "manifest_fuzzer.cc" ]
}
}