Sen Jiang | cc17d32 | 2017-12-22 15:59:23 -0800 | [diff] [blame] | 1 | cc_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 Jiang | cf93f01 | 2018-01-12 11:11:39 -0800 | [diff] [blame] | 16 | "-D_FILE_OFFSET_BITS=64", |
Sen Jiang | cc17d32 | 2017-12-22 15:59:23 -0800 | [diff] [blame] | 17 | "-Wall", |
| 18 | "-Werror", |
| 19 | "-Wextra", |
Chih-Hung Hsieh | e117046 | 2018-09-04 15:47:29 -0700 | [diff] [blame] | 20 | "-Wimplicit-fallthrough", |
Sen Jiang | cc17d32 | 2017-12-22 15:59:23 -0800 | [diff] [blame] | 21 | ], |
Sen Jiang | 12ed900 | 2018-01-02 16:56:42 -0800 | [diff] [blame] | 22 | target: { |
| 23 | darwin: { |
| 24 | enabled: false, |
| 25 | }, |
| 26 | }, |
Sen Jiang | cc17d32 | 2017-12-22 15:59:23 -0800 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | cc_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 | |
| 53 | cc_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 | |
| 68 | cc_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 Jiang | cc17d32 | 2017-12-22 15:59:23 -0800 | [diff] [blame] | 82 | ], |
| 83 | } |
| 84 | |
| 85 | cc_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 Jiang | cc17d32 | 2017-12-22 15:59:23 -0800 | [diff] [blame] | 96 | "src/stream_unittest.cc", |
| 97 | "src/testrunner.cc", |
Amin Hassani | bbcceef | 2018-02-21 16:40:29 -0800 | [diff] [blame] | 98 | "src/unittest_common.cc", |
Sen Jiang | cc17d32 | 2017-12-22 15:59:23 -0800 | [diff] [blame] | 99 | "src/utils_unittest.cc", |
| 100 | ], |
Sen Jiang | cc17d32 | 2017-12-22 15:59:23 -0800 | [diff] [blame] | 101 | static_libs: [ |
| 102 | "libbsdiff", |
| 103 | "libbspatch", |
| 104 | "libdivsufsort", |
| 105 | "libdivsufsort64", |
| 106 | "libpuffdiff", |
| 107 | "libpuffpatch", |
| 108 | ], |
| 109 | } |