blob: 6d2cb857ada9ce8983886461db0b3cdada0c3a98 [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
54 srcs: ["bsdiff.cc"],
55 static_libs: [
56 "libdivsufsort64",
57 "libdivsufsort",
58 ],
59}
60
61// Host and target Executables.
62cc_binary {
63 name: "bspatch",
64 defaults: ["bsdiff_defaults"],
65
66 srcs: ["bspatch_main.cc"],
67 static_libs: [
68 "libbspatch",
69 "libbz",
70 ],
71}
72
73// Host executables, bsdiff is only built for the host.
74cc_binary_host {
75 name: "bsdiff",
76 defaults: ["bsdiff_defaults"],
77
78 srcs: ["bsdiff_main.cc"],
79 static_libs: [
80 "libbsdiff",
81 "libdivsufsort64",
82 "libdivsufsort",
83 "libbz",
84 ],
85}
86
87// Unit tests.
88cc_test {
89 name: "bsdiff_unittest",
90 defaults: ["bsdiff_defaults"],
91 test_suites: ["device-tests"],
92 srcs: [
93 "bsdiff_unittest.cc",
94 "bspatch_unittest.cc",
95 "extents_file_unittest.cc",
96 "extents_unittest.cc",
97 "test_utils.cc",
98 "testrunner.cc",
99 ],
100 cflags: ["-DBSDIFF_TARGET_UNITTEST"],
101 static_libs: [
102 "libbsdiff",
103 "libbspatch",
104 "libgmock",
105 "libdivsufsort64",
106 "libdivsufsort",
107 "libbz",
108 ],
109}