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. 4 5 static_library("courgette_lib") { 6 sources = [ 7 "adjustment_method.cc", 8 "adjustment_method_2.cc", 9 "adjustment_method.h", 10 "assembly_program.cc", 11 "assembly_program.h", 12 "third_party/bsdiff.h", 13 "third_party/bsdiff_apply.cc", 14 "third_party/bsdiff_create.cc", 15 "third_party/paged_array.h", 16 "courgette.h", 17 "crc.cc", 18 "crc.h", 19 "difference_estimator.cc", 20 "difference_estimator.h", 21 "disassembler.cc", 22 "disassembler.h", 23 "disassembler_elf_32.cc", 24 "disassembler_elf_32.h", 25 "disassembler_elf_32_arm.cc", 26 "disassembler_elf_32_arm.h", 27 "disassembler_elf_32_x86.cc", 28 "disassembler_elf_32_x86.h", 29 "disassembler_win32_x86.cc", 30 "disassembler_win32_x86.h", 31 "disassembler_win32_x64.cc", 32 "disassembler_win32_x64.h", 33 "encoded_program.cc", 34 "encoded_program.h", 35 "ensemble.cc", 36 "ensemble.h", 37 "ensemble_apply.cc", 38 "ensemble_create.cc", 39 "memory_allocator.cc", 40 "memory_allocator.h", 41 "region.h", 42 "simple_delta.cc", 43 "simple_delta.h", 44 "streams.cc", 45 "streams.h", 46 "types_elf.h", 47 "types_win_pe.h", 48 "patch_generator_x86_32.h", 49 "patcher_x86_32.h", 50 ] 51 52 deps = [ 53 "//base", 54 "//third_party/lzma_sdk", 55 ] 56 } 57 58 executable("courgette") { 59 if (is_win && cpu_arch == "x64") { 60 # The build infrastructure needs courgette to be named courgette64. 61 output_name = "courgette64" 62 } 63 64 sources = [ 65 "courgette_tool.cc", 66 ] 67 68 if (is_win) { 69 ldflags = [ "/LARGEADDRESSAWARE" ] 70 } 71 72 deps = [ 73 ":courgette_lib", 74 "//base", 75 ] 76 } 77 78 executable("courgette_minimal_tool") { 79 sources = [ 80 "courgette_minimal_tool.cc", 81 ] 82 83 deps = [ 84 ":courgette_lib", 85 "//base", 86 ] 87 } 88 89 test("courgette_unittests") { 90 sources = [ 91 "adjustment_method_unittest.cc", 92 "bsdiff_memory_unittest.cc", 93 "base_test_unittest.cc", 94 "base_test_unittest.h", 95 "difference_estimator_unittest.cc", 96 "disassembler_elf_32_x86_unittest.cc", 97 "disassembler_win32_x86_unittest.cc", 98 "disassembler_win32_x64_unittest.cc", 99 "encoded_program_unittest.cc", 100 "encode_decode_unittest.cc", 101 "ensemble_unittest.cc", 102 "streams_unittest.cc", 103 "typedrva_unittest.cc", 104 "versioning_unittest.cc", 105 "third_party/paged_array_unittest.cc" 106 ] 107 108 if (is_win) { 109 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 110 cflags = [ "/wd4267" ] 111 } 112 113 deps = [ 114 ":courgette_lib", 115 "//base", 116 "//base:i18n", 117 "//base/allocator", 118 "//base/test:run_all_unittests", 119 "//base/test:test_support", 120 "//testing/gtest", 121 ] 122 } 123 124 test("courgette_fuzz") { 125 sources = [ 126 "base_test_unittest.cc", 127 "base_test_unittest.h", 128 "encoded_program_fuzz_unittest.cc", 129 ] 130 deps = [ 131 ":courgette_lib", 132 "//base", 133 "//base:i18n", 134 "//base/test:test_support", 135 "//testing/gtest", 136 ] 137 } 138