blob: 79d124aa7f04d91856f623fcf26cad41d738bf75 [file] [log] [blame]
Sen Jiangcc17d322017-12-22 15:59:23 -08001cc_defaults {
2 name: "puffin_defaults",
3 host_supported: true,
4 shared_libs: [
5 "libbrillo",
6 "libchrome",
7 "libprotobuf-cpp-lite",
8 ],
9 static_libs: [
10 "libbrotli",
11 "libbz",
12 ],
13 export_include_dirs: ["src/include"],
14 cflags: [
15 "-DUSE_BRILLO=1",
Sen Jiangcf93f012018-01-12 11:11:39 -080016 "-D_FILE_OFFSET_BITS=64",
Sen Jiangcc17d322017-12-22 15:59:23 -080017 "-Wall",
18 "-Werror",
19 "-Wextra",
Chih-Hung Hsiehe1170462018-09-04 15:47:29 -070020 "-Wimplicit-fallthrough",
Sen Jiangcc17d322017-12-22 15:59:23 -080021 ],
Sen Jiang12ed9002018-01-02 16:56:42 -080022 target: {
23 darwin: {
24 enabled: false,
25 },
26 },
Sen Jiangcc17d322017-12-22 15:59:23 -080027}
28
29cc_library_static {
30 name: "libpuffpatch",
31 defaults: ["puffin_defaults"],
32 srcs: [
33 "puffin/src/puffin.proto",
34 "src/bit_reader.cc",
35 "src/bit_writer.cc",
36 "src/huffer.cc",
37 "src/huffman_table.cc",
38 "src/puff_reader.cc",
39 "src/puff_writer.cc",
40 "src/puffer.cc",
41 "src/puffin_stream.cc",
42 "src/puffpatch.cc",
43 ],
44 static_libs: [
45 "libbspatch",
46 ],
47 proto: {
48 type: "lite",
49 export_proto_headers: true,
50 },
51}
52
53cc_library_static {
54 name: "libpuffdiff",
55 defaults: ["puffin_defaults"],
56 srcs: [
57 "src/file_stream.cc",
58 "src/memory_stream.cc",
59 "src/puffdiff.cc",
60 "src/utils.cc",
61 ],
62 static_libs: [
63 "libbsdiff",
64 "libpuffpatch",
65 ],
66}
67
68cc_binary {
69 name: "puffin",
70 defaults: ["puffin_defaults"],
71 srcs: [
72 "src/extent_stream.cc",
73 "src/main.cc",
74 ],
75 static_libs: [
76 "libbsdiff",
77 "libbspatch",
78 "libdivsufsort",
79 "libdivsufsort64",
80 "libpuffdiff",
81 "libpuffpatch",
Sen Jiangcc17d322017-12-22 15:59:23 -080082 ],
83}
84
85cc_test {
86 name: "puffin_unittest",
87 defaults: ["puffin_defaults"],
88 test_suites: ["device-tests"],
89 cflags: ["-Wno-sign-compare"],
90 srcs: [
91 "src/bit_io_unittest.cc",
92 "src/extent_stream.cc",
93 "src/patching_unittest.cc",
94 "src/puff_io_unittest.cc",
95 "src/puffin_unittest.cc",
Sen Jiangcc17d322017-12-22 15:59:23 -080096 "src/stream_unittest.cc",
97 "src/testrunner.cc",
Amin Hassanibbcceef2018-02-21 16:40:29 -080098 "src/unittest_common.cc",
Sen Jiangcc17d322017-12-22 15:59:23 -080099 "src/utils_unittest.cc",
100 ],
Sen Jiangcc17d322017-12-22 15:59:23 -0800101 static_libs: [
102 "libbsdiff",
103 "libbspatch",
104 "libdivsufsort",
105 "libdivsufsort64",
106 "libpuffdiff",
107 "libpuffpatch",
108 ],
109}