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
|
# Copyright 2022 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("//third_party/protobuf/proto_library.gni")
group("all") {
deps = [
":libpuffdiff",
":libpuffin-proto",
":libpuffpatch",
":puffin",
]
}
config("target_defaults") {
cflags = [ "-Wextra" ]
cflags_cc = [
"-Wnon-virtual-dtor",
"-Wno-unused-parameter",
]
include_dirs = [
"//third_party/puffin/src/include",
"//third_party",
"//components",
]
defines = [ "_FILE_OFFSET_BITS=64" ]
}
proto_library("libpuffin-proto") {
sources = [ "src/puffin.proto" ]
proto_out_dir = "puffin/src"
}
static_library("libpuffpatch") {
configs += [ ":target_defaults" ]
deps = [
":libpuffin-proto",
"//base",
"//components/zucchini:zucchini_lib",
"//third_party/brotli:dec",
"//third_party/brotli:enc",
]
sources = [
"src/bit_reader.cc",
"src/bit_writer.cc",
"src/brotli_util.cc",
"src/file_stream.cc",
"src/huffer.cc",
"src/huffman_table.cc",
"src/memory_stream.cc",
"src/puff_reader.cc",
"src/puff_writer.cc",
"src/puffer.cc",
"src/puffin_stream.cc",
"src/puffpatch.cc",
]
}
static_library("libpuffdiff") {
configs += [ ":target_defaults" ]
deps = [
":libpuffin-proto",
"//base",
"//components/zucchini:zucchini_lib",
"//third_party/brotli:dec",
"//third_party/brotli:enc",
]
sources = [
"src/file_stream.cc",
"src/puffdiff.cc",
"src/utils.cc",
]
}
executable("puffin") {
configs += [ ":target_defaults" ]
deps = [
":libpuffdiff",
":libpuffpatch",
"//base",
]
sources = [ "src/chromium_main.cc" ]
}
config("test_defaults") {
cflags = [
"-Wextra",
"-Wno-sign-compare",
]
cflags_cc = [
"-Wnon-virtual-dtor",
"-Wno-unused-parameter",
]
include_dirs = [
"../protobuf/src",
"src/include",
"//third_party",
"//components",
]
defines = [ "_FILE_OFFSET_BITS=64" ]
}
executable("puffin_unittest") {
testonly = true
configs += [ ":test_defaults" ]
sources = [
"src/bit_io_unittest.cc",
"src/brotli_util_unittest.cc",
"src/integration_test.cc",
"src/patching_unittest.cc",
"src/puff_io_unittest.cc",
"src/puffin_unittest.cc",
"src/stream_unittest.cc",
"src/testrunner.cc",
"src/unittest_common.cc",
"src/utils_unittest.cc",
]
deps = [
":libpuffdiff",
":libpuffpatch",
"//base",
"//testing/gtest:gtest",
]
}
|