summaryrefslogtreecommitdiffstats
path: root/courgette/BUILD.gn
blob: ce89c42c11206ee3536a3df545f33e61a6f6a230 (plain)
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
125
126
127
128
129
130
131
132
133
134
135
136
137
# Copyright 2014 The Chromium 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("//testing/test.gni")

static_library("courgette_lib") {
  sources = [
    "adjustment_method.cc",
    "adjustment_method.h",
    "adjustment_method_2.cc",
    "assembly_program.cc",
    "assembly_program.h",
    "courgette.h",
    "crc.cc",
    "crc.h",
    "difference_estimator.cc",
    "difference_estimator.h",
    "disassembler.cc",
    "disassembler.h",
    "disassembler_elf_32.cc",
    "disassembler_elf_32.h",
    "disassembler_elf_32_arm.cc",
    "disassembler_elf_32_arm.h",
    "disassembler_elf_32_x86.cc",
    "disassembler_elf_32_x86.h",
    "disassembler_win32_x64.cc",
    "disassembler_win32_x64.h",
    "disassembler_win32_x86.cc",
    "disassembler_win32_x86.h",
    "encoded_program.cc",
    "encoded_program.h",
    "ensemble.cc",
    "ensemble.h",
    "ensemble_apply.cc",
    "ensemble_create.cc",
    "memory_allocator.cc",
    "memory_allocator.h",
    "patch_generator_x86_32.h",
    "patcher_x86_32.h",
    "region.h",
    "simple_delta.cc",
    "simple_delta.h",
    "streams.cc",
    "streams.h",
    "third_party/bsdiff.h",
    "third_party/bsdiff_apply.cc",
    "third_party/bsdiff_create.cc",
    "third_party/paged_array.h",
    "types_elf.h",
    "types_win_pe.h",
  ]

  deps = [
    "//base",
    "//third_party/lzma_sdk",
  ]
}

executable("courgette") {
  if (is_win && current_cpu == "x64") {
    # The build infrastructure needs courgette to be named courgette64.
    output_name = "courgette64"
  }

  sources = [
    "courgette_tool.cc",
  ]

  if (is_win) {
    ldflags = [ "/LARGEADDRESSAWARE" ]
  }

  deps = [
    ":courgette_lib",
    "//base",
  ]
}

executable("courgette_minimal_tool") {
  sources = [
    "courgette_minimal_tool.cc",
  ]

  deps = [
    ":courgette_lib",
    "//base",
  ]
}

test("courgette_unittests") {
  sources = [
    "adjustment_method_unittest.cc",
    "base_test_unittest.cc",
    "base_test_unittest.h",
    "bsdiff_memory_unittest.cc",
    "difference_estimator_unittest.cc",
    "disassembler_elf_32_x86_unittest.cc",
    "disassembler_win32_x64_unittest.cc",
    "disassembler_win32_x86_unittest.cc",
    "encode_decode_unittest.cc",
    "encoded_program_unittest.cc",
    "ensemble_unittest.cc",
    "streams_unittest.cc",
    "third_party/paged_array_unittest.cc",
    "typedrva_unittest.cc",
    "versioning_unittest.cc",
  ]

  # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
  configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

  deps = [
    ":courgette_lib",
    "//base",
    "//base:i18n",
    "//base/allocator",
    "//base/test:run_all_unittests",
    "//base/test:test_support",
    "//testing/gtest",
  ]
}

test("courgette_fuzz") {
  sources = [
    "base_test_unittest.cc",
    "base_test_unittest.h",
    "encoded_program_fuzz_unittest.cc",
  ]
  deps = [
    ":courgette_lib",
    "//base",
    "//base:i18n",
    "//base/test:test_support",
    "//testing/gtest",
  ]
}