blob: 25a31c27a49ab1abab4c6a12370881ae970aebfb [file] [log] [blame]
Alex Deymo831dc452017-09-07 21:09:58 +02001// Copyright (C) 2008 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15cc_defaults {
16 name: "bsdiff_defaults",
17 host_supported: true,
18 static_libs: ["libbz"],
19 export_include_dirs: [
20 "include",
21 // TODO(deymo): Remove include/bsdiff when all callers use the "bsdiff/"
22 // prefix when including code.
23 "include/bsdiff",
24 ],
25 cflags: [
26 "-D_FILE_OFFSET_BITS=64",
27 "-Wall",
28 "-Werror",
29 "-Wextra",
30 "-Wno-unused-parameter",
31 ],
32}
33
34// Host and target static libraries.
35cc_library_static {
36 name: "libbspatch",
37 defaults: ["bsdiff_defaults"],
38
39 srcs: [
40 "bspatch.cc",
41 "buffer_file.cc",
42 "extents.cc",
43 "extents_file.cc",
44 "file.cc",
45 "memory_file.cc",
46 "sink_file.cc",
47 ],
48}
49
50cc_library_static {
51 name: "libbsdiff",
52 defaults: ["bsdiff_defaults"],
53
Alex Deymoa28e0192017-09-08 14:21:05 +020054 srcs: [
55 "bsdiff.cc",
56 "bz2_compressor.cc",
57 "patch_writer.cc",
58 ],
Alex Deymo831dc452017-09-07 21:09:58 +020059 static_libs: [
60 "libdivsufsort64",
61 "libdivsufsort",
62 ],
63}
64
65// Host and target Executables.
66cc_binary {
67 name: "bspatch",
68 defaults: ["bsdiff_defaults"],
69
70 srcs: ["bspatch_main.cc"],
71 static_libs: [
72 "libbspatch",
73 "libbz",
74 ],
75}
76
77// Host executables, bsdiff is only built for the host.
78cc_binary_host {
79 name: "bsdiff",
80 defaults: ["bsdiff_defaults"],
81
82 srcs: ["bsdiff_main.cc"],
83 static_libs: [
84 "libbsdiff",
85 "libdivsufsort64",
86 "libdivsufsort",
87 "libbz",
88 ],
89}
90
91// Unit tests.
92cc_test {
93 name: "bsdiff_unittest",
94 defaults: ["bsdiff_defaults"],
95 test_suites: ["device-tests"],
96 srcs: [
97 "bsdiff_unittest.cc",
98 "bspatch_unittest.cc",
99 "extents_file_unittest.cc",
100 "extents_unittest.cc",
101 "test_utils.cc",
102 "testrunner.cc",
103 ],
104 cflags: ["-DBSDIFF_TARGET_UNITTEST"],
105 static_libs: [
106 "libbsdiff",
107 "libbspatch",
108 "libgmock",
109 "libdivsufsort64",
110 "libdivsufsort",
111 "libbz",
112 ],
113}