reloc_packer: Allow aarch64 DSO linked with gold
[chromium-blink-merge.git] / courgette / BUILD.gn
blobd277eb9e887da34f49d91afba12c2f9e936d26cc
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//testing/test.gni")
7 static_library("courgette_lib") {
8   sources = [
9     "adjustment_method.cc",
10     "adjustment_method_2.cc",
11     "adjustment_method.h",
12     "assembly_program.cc",
13     "assembly_program.h",
14     "third_party/bsdiff.h",
15     "third_party/bsdiff_apply.cc",
16     "third_party/bsdiff_create.cc",
17     "third_party/paged_array.h",
18     "courgette.h",
19     "crc.cc",
20     "crc.h",
21     "difference_estimator.cc",
22     "difference_estimator.h",
23     "disassembler.cc",
24     "disassembler.h",
25     "disassembler_elf_32.cc",
26     "disassembler_elf_32.h",
27     "disassembler_elf_32_arm.cc",
28     "disassembler_elf_32_arm.h",
29     "disassembler_elf_32_x86.cc",
30     "disassembler_elf_32_x86.h",
31     "disassembler_win32_x86.cc",
32     "disassembler_win32_x86.h",
33     "disassembler_win32_x64.cc",
34     "disassembler_win32_x64.h",
35     "encoded_program.cc",
36     "encoded_program.h",
37     "ensemble.cc",
38     "ensemble.h",
39     "ensemble_apply.cc",
40     "ensemble_create.cc",
41     "memory_allocator.cc",
42     "memory_allocator.h",
43     "region.h",
44     "simple_delta.cc",
45     "simple_delta.h",
46     "streams.cc",
47     "streams.h",
48     "types_elf.h",
49     "types_win_pe.h",
50     "patch_generator_x86_32.h",
51     "patcher_x86_32.h",
52   ]
54   deps = [
55     "//base",
56     "//third_party/lzma_sdk",
57   ]
60 executable("courgette") {
61   if (is_win && cpu_arch == "x64") {
62     # The build infrastructure needs courgette to be named courgette64.
63     output_name = "courgette64"
64   }
66   sources = [
67     "courgette_tool.cc",
68   ]
70   if (is_win) {
71     ldflags = [ "/LARGEADDRESSAWARE" ]
72   }
74   deps = [
75     ":courgette_lib",
76     "//base",
77   ]
80 executable("courgette_minimal_tool") {
81   sources = [
82     "courgette_minimal_tool.cc",
83   ]
85   deps = [
86     ":courgette_lib",
87     "//base",
88   ]
91 test("courgette_unittests") {
92   sources = [
93     "adjustment_method_unittest.cc",
94     "bsdiff_memory_unittest.cc",
95     "base_test_unittest.cc",
96     "base_test_unittest.h",
97     "difference_estimator_unittest.cc",
98     "disassembler_elf_32_x86_unittest.cc",
99     "disassembler_win32_x86_unittest.cc",
100     "disassembler_win32_x64_unittest.cc",
101     "encoded_program_unittest.cc",
102     "encode_decode_unittest.cc",
103     "ensemble_unittest.cc",
104     "streams_unittest.cc",
105     "typedrva_unittest.cc",
106     "versioning_unittest.cc",
107     "third_party/paged_array_unittest.cc",
108   ]
110   if (is_win) {
111     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
112     cflags = [ "/wd4267" ]
113   }
115   deps = [
116     ":courgette_lib",
117     "//base",
118     "//base:i18n",
119     "//base/allocator",
120     "//base/test:run_all_unittests",
121     "//base/test:test_support",
122     "//testing/gtest",
123   ]
126 test("courgette_fuzz") {
127   sources = [
128     "base_test_unittest.cc",
129     "base_test_unittest.h",
130     "encoded_program_fuzz_unittest.cc",
131   ]
132   deps = [
133     ":courgette_lib",
134     "//base",
135     "//base:i18n",
136     "//base/test:test_support",
137     "//testing/gtest",
138   ]