OLD | NEW |
(Empty) | |
| 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 # This file was forked from breakpad/BUILD.gn in chromium. |
| 6 |
| 7 import("//testing/test.gni") |
| 8 |
| 9 config("tools_config") { |
| 10 include_dirs = [ |
| 11 "src", |
| 12 "src/third_party", |
| 13 ] |
| 14 if (is_android) { |
| 15 defines = [ "__ANDROID__" ] |
| 16 } |
| 17 if (is_clang) { |
| 18 cflags = [ "-Wno-tautological-constant-out-of-range-compare" ] |
| 19 } |
| 20 } |
| 21 |
| 22 config("internal_config") { |
| 23 include_dirs = [ "src" ] |
| 24 defines = [] |
| 25 if (is_debug) { |
| 26 # This is needed for GTMLogger to work correctly. |
| 27 defines += [ "DEBUG" ] |
| 28 } |
| 29 if (is_android) { |
| 30 defines += [ "__ANDROID__" ] |
| 31 } |
| 32 } |
| 33 |
| 34 config("client_config") { |
| 35 include_dirs = [ "src" ] |
| 36 if (is_android) { |
| 37 include_dirs += [ "src/common/android/include" ] |
| 38 } |
| 39 } |
| 40 |
| 41 config("handler_config") { |
| 42 include_dirs = [ "src" ] |
| 43 } |
| 44 |
| 45 config("sender_config") { |
| 46 include_dirs = [ "src" ] |
| 47 } |
| 48 |
| 49 # {micro,mini}dump_stackwalk and minidump_dump are tool-type executables that do |
| 50 # not build on iOS. |
| 51 if (current_toolchain == host_toolchain && !is_win) { |
| 52 # Contains the code shared by both {micro,mini}dump_stackwalk. |
| 53 static_library("stackwalk_common") { |
| 54 sources = [ |
| 55 "src/processor/basic_code_module.h", |
| 56 "src/processor/basic_code_modules.cc", |
| 57 "src/processor/basic_code_modules.h", |
| 58 "src/processor/basic_source_line_resolver.cc", |
| 59 "src/processor/binarystream.cc", |
| 60 "src/processor/binarystream.h", |
| 61 "src/processor/call_stack.cc", |
| 62 "src/processor/cfi_frame_info.cc", |
| 63 "src/processor/cfi_frame_info.h", |
| 64 "src/processor/disassembler_x86.cc", |
| 65 "src/processor/disassembler_x86.h", |
| 66 "src/processor/dump_context.cc", |
| 67 "src/processor/dump_object.cc", |
| 68 "src/processor/logging.cc", |
| 69 "src/processor/logging.h", |
| 70 "src/processor/pathname_stripper.cc", |
| 71 "src/processor/pathname_stripper.h", |
| 72 "src/processor/process_state.cc", |
| 73 "src/processor/simple_symbol_supplier.cc", |
| 74 "src/processor/simple_symbol_supplier.h", |
| 75 "src/processor/source_line_resolver_base.cc", |
| 76 "src/processor/stack_frame_cpu.cc", |
| 77 "src/processor/stack_frame_symbolizer.cc", |
| 78 "src/processor/stackwalk_common.cc", |
| 79 "src/processor/stackwalker.cc", |
| 80 "src/processor/stackwalker_amd64.cc", |
| 81 "src/processor/stackwalker_amd64.h", |
| 82 "src/processor/stackwalker_arm.cc", |
| 83 "src/processor/stackwalker_arm.h", |
| 84 "src/processor/stackwalker_arm64.cc", |
| 85 "src/processor/stackwalker_arm64.h", |
| 86 "src/processor/stackwalker_mips.cc", |
| 87 "src/processor/stackwalker_mips.h", |
| 88 "src/processor/stackwalker_ppc.cc", |
| 89 "src/processor/stackwalker_ppc.h", |
| 90 "src/processor/stackwalker_ppc64.cc", |
| 91 "src/processor/stackwalker_ppc64.h", |
| 92 "src/processor/stackwalker_sparc.cc", |
| 93 "src/processor/stackwalker_sparc.h", |
| 94 "src/processor/stackwalker_x86.cc", |
| 95 "src/processor/stackwalker_x86.h", |
| 96 "src/processor/tokenize.cc", |
| 97 "src/processor/tokenize.h", |
| 98 |
| 99 # libdisasm |
| 100 "src/third_party/libdisasm/ia32_implicit.c", |
| 101 "src/third_party/libdisasm/ia32_implicit.h", |
| 102 "src/third_party/libdisasm/ia32_insn.c", |
| 103 "src/third_party/libdisasm/ia32_insn.h", |
| 104 "src/third_party/libdisasm/ia32_invariant.c", |
| 105 "src/third_party/libdisasm/ia32_invariant.h", |
| 106 "src/third_party/libdisasm/ia32_modrm.c", |
| 107 "src/third_party/libdisasm/ia32_modrm.h", |
| 108 "src/third_party/libdisasm/ia32_opcode_tables.c", |
| 109 "src/third_party/libdisasm/ia32_opcode_tables.h", |
| 110 "src/third_party/libdisasm/ia32_operand.c", |
| 111 "src/third_party/libdisasm/ia32_operand.h", |
| 112 "src/third_party/libdisasm/ia32_reg.c", |
| 113 "src/third_party/libdisasm/ia32_reg.h", |
| 114 "src/third_party/libdisasm/ia32_settings.c", |
| 115 "src/third_party/libdisasm/ia32_settings.h", |
| 116 "src/third_party/libdisasm/libdis.h", |
| 117 "src/third_party/libdisasm/qword.h", |
| 118 "src/third_party/libdisasm/x86_disasm.c", |
| 119 "src/third_party/libdisasm/x86_format.c", |
| 120 "src/third_party/libdisasm/x86_imm.c", |
| 121 "src/third_party/libdisasm/x86_imm.h", |
| 122 "src/third_party/libdisasm/x86_insn.c", |
| 123 "src/third_party/libdisasm/x86_misc.c", |
| 124 "src/third_party/libdisasm/x86_operand_list.c", |
| 125 "src/third_party/libdisasm/x86_operand_list.h", |
| 126 ] |
| 127 |
| 128 defines = [ "BPLOG_MINIMUM_SEVERITY=SEVERITY_ERROR" ] |
| 129 |
| 130 configs -= [ "//build/config/compiler:chromium_code" ] |
| 131 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 132 configs += [ ":tools_config" ] |
| 133 } |
| 134 |
| 135 executable("microdump_stackwalk") { |
| 136 sources = [ |
| 137 "src/processor/microdump.cc", |
| 138 "src/processor/microdump_processor.cc", |
| 139 "src/processor/microdump_stackwalk.cc", |
| 140 ] |
| 141 |
| 142 deps = [ |
| 143 ":stackwalk_common", |
| 144 ] |
| 145 |
| 146 defines = [ "BPLOG_MINIMUM_SEVERITY=SEVERITY_ERROR" ] |
| 147 |
| 148 configs -= [ "//build/config/compiler:chromium_code" ] |
| 149 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 150 configs += [ ":tools_config" ] |
| 151 } |
| 152 |
| 153 executable("minidump_stackwalk") { |
| 154 sources = [ |
| 155 "src/processor/exploitability.cc", |
| 156 "src/processor/minidump.cc", |
| 157 "src/processor/minidump_processor.cc", |
| 158 "src/processor/minidump_stackwalk.cc", |
| 159 ] |
| 160 |
| 161 deps = [ |
| 162 ":stackwalk_common", |
| 163 ] |
| 164 |
| 165 defines = [ "BPLOG_MINIMUM_SEVERITY=SEVERITY_ERROR" ] |
| 166 |
| 167 configs -= [ "//build/config/compiler:chromium_code" ] |
| 168 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 169 configs += [ ":tools_config" ] |
| 170 |
| 171 # Always want these files included regardless of platform. |
| 172 set_sources_assignment_filter([]) |
| 173 sources += [ |
| 174 "src/processor/exploitability_linux.cc", |
| 175 "src/processor/exploitability_linux.h", |
| 176 "src/processor/exploitability_win.cc", |
| 177 "src/processor/exploitability_win.h", |
| 178 "src/processor/symbolic_constants_win.cc", |
| 179 "src/processor/symbolic_constants_win.h", |
| 180 ] |
| 181 } |
| 182 |
| 183 executable("minidump_dump") { |
| 184 sources = [ |
| 185 "src/processor/basic_code_module.h", |
| 186 "src/processor/basic_code_modules.cc", |
| 187 "src/processor/basic_code_modules.h", |
| 188 "src/processor/dump_context.cc", |
| 189 "src/processor/dump_object.cc", |
| 190 "src/processor/logging.cc", |
| 191 "src/processor/logging.h", |
| 192 "src/processor/minidump.cc", |
| 193 "src/processor/minidump_dump.cc", |
| 194 "src/processor/pathname_stripper.cc", |
| 195 "src/processor/pathname_stripper.h", |
| 196 ] |
| 197 |
| 198 configs += [ ":tools_config" ] |
| 199 |
| 200 # There are some warnings in this code. |
| 201 configs -= [ "//build/config/compiler:chromium_code" ] |
| 202 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 203 } |
| 204 } |
| 205 |
| 206 # Mac -------------------------------------------------------------------------- |
| 207 |
| 208 if (current_toolchain == host_toolchain && is_mac) { |
| 209 # TODO(GYP) This should be only 64-bit on Mac. From .gypi: |
| 210 # Like ld, dump_syms needs to operate on enough data that it may |
| 211 # actually need to be able to address more than 4GB. Use x86_64. |
| 212 # Don't worry! An x86_64 dump_syms is perfectly able to dump |
| 213 # 32-bit files. |
| 214 executable("dump_syms") { |
| 215 sources = [ |
| 216 "src/common/dwarf/bytereader.cc", |
| 217 "src/common/dwarf/dwarf2diehandler.cc", |
| 218 "src/common/dwarf/dwarf2reader.cc", |
| 219 "src/common/dwarf_cfi_to_module.cc", |
| 220 "src/common/dwarf_cu_to_module.cc", |
| 221 "src/common/dwarf_line_to_module.cc", |
| 222 "src/common/language.cc", |
| 223 "src/common/mac/arch_utilities.cc", |
| 224 "src/common/mac/arch_utilities.h", |
| 225 "src/common/mac/dump_syms.mm", |
| 226 "src/common/mac/file_id.cc", |
| 227 "src/common/mac/macho_id.cc", |
| 228 "src/common/mac/macho_reader.cc", |
| 229 "src/common/mac/macho_utilities.cc", |
| 230 "src/common/mac/macho_walker.cc", |
| 231 "src/common/md5.cc", |
| 232 "src/common/module.cc", |
| 233 "src/common/stabs_reader.cc", |
| 234 "src/common/stabs_to_module.cc", |
| 235 "src/tools/mac/dump_syms/dump_syms_tool.mm", |
| 236 ] |
| 237 |
| 238 # For src/common/stabs_reader.h. |
| 239 defines = [ "HAVE_MACH_O_NLIST_H" ] |
| 240 include_dirs = [ "src/common/mac" ] |
| 241 |
| 242 # The DWARF utilities require -funsigned-char. |
| 243 cflags = [ "-funsigned-char" ] |
| 244 |
| 245 configs += [ ":internal_config" ] |
| 246 |
| 247 configs -= [ "//build/config/compiler:chromium_code" ] |
| 248 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 249 |
| 250 # dwarf2reader.cc uses dynamic_cast. |
| 251 configs -= [ "//build/config/compiler:no_rtti" ] |
| 252 configs += [ "//build/config/compiler:rtti" ] |
| 253 |
| 254 libs = [ "Foundation.framework" ] |
| 255 |
| 256 if (!is_debug) { |
| 257 # dump_syms crashes when built at -O1, -O2, and -O3. It does |
| 258 # not crash at -Os. To play it safe, dump_syms is always built |
| 259 # at -O0 until this can be sorted out. |
| 260 # http://code.google.com/p/google-breakpad/issues/detail?id=329 |
| 261 configs -= [ "//build/config/compiler:optimize" ] |
| 262 cflags += [ "-O0" ] |
| 263 } |
| 264 } |
| 265 |
| 266 executable("symupload") { |
| 267 sources = [ |
| 268 "src/common/mac/HTTPMultipartUpload.m", |
| 269 "src/tools/mac/symupload/symupload.m", |
| 270 ] |
| 271 |
| 272 include_dirs = [ "src/common/mac" ] |
| 273 |
| 274 libs = [ "Foundation.framework" ] |
| 275 |
| 276 configs -= [ "//build/config/compiler:chromium_code" ] |
| 277 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 278 } |
| 279 } |
| 280 |
| 281 if (is_mac) { |
| 282 static_library("utilities") { |
| 283 sources = [ |
| 284 "src/client/mac/crash_generation/ConfigFile.mm", |
| 285 "src/client/mac/handler/breakpad_nlist_64.cc", |
| 286 "src/client/mac/handler/dynamic_images.cc", |
| 287 "src/client/mac/handler/minidump_generator.cc", |
| 288 "src/client/minidump_file_writer.cc", |
| 289 "src/common/convert_UTF.c", |
| 290 "src/common/mac/MachIPC.mm", |
| 291 "src/common/mac/arch_utilities.cc", |
| 292 "src/common/mac/bootstrap_compat.cc", |
| 293 "src/common/mac/file_id.cc", |
| 294 "src/common/mac/launch_reporter.cc", |
| 295 "src/common/mac/macho_id.cc", |
| 296 "src/common/mac/macho_utilities.cc", |
| 297 "src/common/mac/macho_walker.cc", |
| 298 "src/common/mac/string_utilities.cc", |
| 299 "src/common/md5.cc", |
| 300 "src/common/simple_string_dictionary.cc", |
| 301 "src/common/string_conversion.cc", |
| 302 ] |
| 303 |
| 304 configs += [ ":internal_config" ] |
| 305 |
| 306 # There are some warnings in this code. |
| 307 configs -= [ "//build/config/compiler:chromium_code" ] |
| 308 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 309 } |
| 310 |
| 311 executable("crash_inspector") { |
| 312 sources = [ |
| 313 "src/client/mac/crash_generation/Inspector.mm", |
| 314 "src/client/mac/crash_generation/InspectorMain.mm", |
| 315 ] |
| 316 |
| 317 # TODO(GYP): 'mac_real_dsym': 1, |
| 318 |
| 319 include_dirs = [ |
| 320 "src/client/apple/Framework", |
| 321 "src/common/mac", |
| 322 "src", |
| 323 ] |
| 324 libs = [ |
| 325 "CoreServices.framework", |
| 326 "Foundation.framework", |
| 327 ] |
| 328 |
| 329 deps = [ |
| 330 ":utilities", |
| 331 ] |
| 332 } |
| 333 |
| 334 # TODO(GYP) this target has some mac_bundle_resources stuff. |
| 335 # executable("crash_report_sender") { |
| 336 # } |
| 337 group("crash_report_sender") { |
| 338 } |
| 339 |
| 340 config("breakpad_config") { |
| 341 include_dirs = [ "src/client/apple/Framework" ] |
| 342 } |
| 343 |
| 344 static_library("breakpad") { |
| 345 sources = [ |
| 346 "src/client/mac/Framework/Breakpad.mm", |
| 347 "src/client/mac/Framework/OnDemandServer.mm", |
| 348 "src/client/mac/crash_generation/crash_generation_client.cc", |
| 349 "src/client/mac/crash_generation/crash_generation_client.h", |
| 350 "src/client/mac/handler/exception_handler.cc", |
| 351 "src/client/mac/handler/protected_memory_allocator.cc", |
| 352 ] |
| 353 |
| 354 configs += [ ":internal_config" ] |
| 355 public_configs = [ ":breakpad_config" ] |
| 356 |
| 357 defines = [ "USE_PROTECTED_ALLOCATIONS=1" ] |
| 358 include_dirs = [ "src/client/apple/Framework" ] |
| 359 |
| 360 deps = [ |
| 361 ":utilities", |
| 362 ":crash_inspector", |
| 363 ":crash_report_sender", |
| 364 ] |
| 365 } |
| 366 |
| 367 group("client") { |
| 368 public_configs = [ ":client_config" ] |
| 369 } |
| 370 } |
| 371 |
| 372 if (is_linux) { |
| 373 executable("symupload") { |
| 374 sources = [ |
| 375 "src/common/linux/http_upload.cc", |
| 376 "src/common/linux/http_upload.h", |
| 377 "src/tools/linux/symupload/sym_upload.cc", |
| 378 ] |
| 379 |
| 380 include_dirs = [ |
| 381 "src", |
| 382 "src/third_party", |
| 383 ] |
| 384 |
| 385 configs += [ ":tools_config" ] |
| 386 |
| 387 libs = [ "dl" ] |
| 388 } |
| 389 } |
| 390 |
| 391 if (is_linux || is_android) { |
| 392 if (current_toolchain == host_toolchain) { |
| 393 # dump_syms is a host tool, so only compile it for the host system. |
| 394 executable("dump_syms") { |
| 395 sources = [ |
| 396 "src/common/dwarf/bytereader.cc", |
| 397 "src/common/dwarf/dwarf2diehandler.cc", |
| 398 "src/common/dwarf/dwarf2reader.cc", |
| 399 "src/common/dwarf_cfi_to_module.cc", |
| 400 "src/common/dwarf_cfi_to_module.h", |
| 401 "src/common/dwarf_cu_to_module.cc", |
| 402 "src/common/dwarf_cu_to_module.h", |
| 403 "src/common/dwarf_line_to_module.cc", |
| 404 "src/common/dwarf_line_to_module.h", |
| 405 "src/common/language.cc", |
| 406 "src/common/language.h", |
| 407 "src/common/linux/crc32.cc", |
| 408 "src/common/linux/crc32.h", |
| 409 "src/common/linux/dump_symbols.cc", |
| 410 "src/common/linux/dump_symbols.h", |
| 411 "src/common/linux/elf_symbols_to_module.cc", |
| 412 "src/common/linux/elf_symbols_to_module.h", |
| 413 "src/common/linux/elfutils.cc", |
| 414 "src/common/linux/elfutils.h", |
| 415 "src/common/linux/file_id.cc", |
| 416 "src/common/linux/file_id.h", |
| 417 "src/common/linux/guid_creator.h", |
| 418 "src/common/linux/linux_libc_support.cc", |
| 419 "src/common/linux/linux_libc_support.h", |
| 420 "src/common/linux/memory_mapped_file.cc", |
| 421 "src/common/linux/memory_mapped_file.h", |
| 422 "src/common/module.cc", |
| 423 "src/common/module.h", |
| 424 "src/common/stabs_reader.cc", |
| 425 "src/common/stabs_reader.h", |
| 426 "src/common/stabs_to_module.cc", |
| 427 "src/common/stabs_to_module.h", |
| 428 "src/tools/linux/dump_syms/dump_syms.cc", |
| 429 ] |
| 430 |
| 431 # There are some warnings in this code. |
| 432 configs -= [ "//build/config/compiler:chromium_code" ] |
| 433 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 434 |
| 435 # dwarf2reader.cc uses dynamic_cast. Because we don't typically |
| 436 # don't support RTTI, we enable it for this single target. Since |
| 437 # dump_syms doesn't share any object files with anything else, |
| 438 # this doesn't end up polluting Chrome itself. |
| 439 configs -= [ "//build/config/compiler:no_rtti" ] |
| 440 configs += [ "//build/config/compiler:rtti" ] |
| 441 |
| 442 # Breakpad rev 583 introduced this flag. |
| 443 # Using this define, stabs_reader.h will include a.out.h to |
| 444 # build on Linux. |
| 445 defines = [ "HAVE_A_OUT_H" ] |
| 446 |
| 447 include_dirs = [ "src" ] |
| 448 } |
| 449 } |
| 450 |
| 451 static_library("client") { |
| 452 # Want all these sources for both Linux and Android. |
| 453 set_sources_assignment_filter([]) |
| 454 sources = [ |
| 455 "src/client/linux/crash_generation/crash_generation_client.cc", |
| 456 "src/client/linux/crash_generation/crash_generation_client.h", |
| 457 "src/client/linux/dump_writer_common/mapping_info.h", |
| 458 "src/client/linux/dump_writer_common/seccomp_unwinder.cc", |
| 459 "src/client/linux/dump_writer_common/seccomp_unwinder.h", |
| 460 "src/client/linux/dump_writer_common/thread_info.cc", |
| 461 "src/client/linux/dump_writer_common/thread_info.h", |
| 462 "src/client/linux/dump_writer_common/ucontext_reader.cc", |
| 463 "src/client/linux/dump_writer_common/ucontext_reader.h", |
| 464 "src/client/linux/handler/exception_handler.cc", |
| 465 "src/client/linux/handler/exception_handler.h", |
| 466 "src/client/linux/handler/minidump_descriptor.cc", |
| 467 "src/client/linux/handler/minidump_descriptor.h", |
| 468 "src/client/linux/log/log.cc", |
| 469 "src/client/linux/log/log.h", |
| 470 "src/client/linux/microdump_writer/microdump_writer.cc", |
| 471 "src/client/linux/microdump_writer/microdump_writer.h", |
| 472 "src/client/linux/minidump_writer/cpu_set.h", |
| 473 "src/client/linux/minidump_writer/directory_reader.h", |
| 474 "src/client/linux/minidump_writer/line_reader.h", |
| 475 "src/client/linux/minidump_writer/linux_core_dumper.cc", |
| 476 "src/client/linux/minidump_writer/linux_core_dumper.h", |
| 477 "src/client/linux/minidump_writer/linux_dumper.cc", |
| 478 "src/client/linux/minidump_writer/linux_dumper.h", |
| 479 "src/client/linux/minidump_writer/linux_ptrace_dumper.cc", |
| 480 "src/client/linux/minidump_writer/linux_ptrace_dumper.h", |
| 481 "src/client/linux/minidump_writer/minidump_writer.cc", |
| 482 "src/client/linux/minidump_writer/minidump_writer.h", |
| 483 "src/client/linux/minidump_writer/proc_cpuinfo_reader.h", |
| 484 "src/client/minidump_file_writer-inl.h", |
| 485 "src/client/minidump_file_writer.cc", |
| 486 "src/client/minidump_file_writer.h", |
| 487 "src/common/convert_UTF.c", |
| 488 "src/common/convert_UTF.h", |
| 489 "src/common/linux/elf_core_dump.cc", |
| 490 "src/common/linux/elf_core_dump.h", |
| 491 "src/common/linux/elfutils.cc", |
| 492 "src/common/linux/elfutils.h", |
| 493 "src/common/linux/file_id.cc", |
| 494 "src/common/linux/file_id.h", |
| 495 "src/common/linux/google_crashdump_uploader.cc", |
| 496 "src/common/linux/google_crashdump_uploader.h", |
| 497 "src/common/linux/guid_creator.cc", |
| 498 "src/common/linux/guid_creator.h", |
| 499 "src/common/linux/libcurl_wrapper.cc", |
| 500 "src/common/linux/libcurl_wrapper.h", |
| 501 "src/common/linux/linux_libc_support.cc", |
| 502 "src/common/linux/linux_libc_support.h", |
| 503 "src/common/linux/memory_mapped_file.cc", |
| 504 "src/common/linux/memory_mapped_file.h", |
| 505 "src/common/linux/safe_readlink.cc", |
| 506 "src/common/linux/safe_readlink.h", |
| 507 "src/common/memory.h", |
| 508 "src/common/simple_string_dictionary.cc", |
| 509 "src/common/simple_string_dictionary.h", |
| 510 "src/common/string_conversion.cc", |
| 511 "src/common/string_conversion.h", |
| 512 ] |
| 513 |
| 514 configs -= [ "//build/config/compiler:chromium_code" ] |
| 515 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 516 public_configs = [ ":client_config" ] |
| 517 |
| 518 if (current_cpu == "arm" && is_chromeos) { |
| 519 # Avoid running out of registers in |
| 520 # linux_syscall_support.h:sys_clone()'s inline assembly. |
| 521 cflags = [ "-marm" ] |
| 522 } |
| 523 |
| 524 if (is_android) { |
| 525 sources += [ "src/common/android/breakpad_getcontext.S" ] |
| 526 } |
| 527 |
| 528 libs = [ "dl" ] |
| 529 |
| 530 include_dirs = [ |
| 531 ".", |
| 532 "src", |
| 533 "src/client", |
| 534 "src/third_party/linux/include", |
| 535 ] |
| 536 } |
| 537 |
| 538 static_library("processor_support") { |
| 539 sources = [ |
| 540 "src/common/scoped_ptr.h", |
| 541 "src/processor/basic_code_modules.cc", |
| 542 "src/processor/basic_code_modules.h", |
| 543 "src/processor/dump_context.cc", |
| 544 "src/processor/dump_object.cc", |
| 545 "src/processor/logging.cc", |
| 546 "src/processor/logging.h", |
| 547 "src/processor/minidump.cc", |
| 548 "src/processor/pathname_stripper.cc", |
| 549 "src/processor/pathname_stripper.h", |
| 550 ] |
| 551 |
| 552 include_dirs = [ |
| 553 "src", |
| 554 "src/client", |
| 555 "src/third_party/linux/include", |
| 556 ".", |
| 557 ] |
| 558 |
| 559 # There are some warnings in this code. |
| 560 configs -= [ "//build/config/compiler:chromium_code" ] |
| 561 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 562 } |
| 563 } |
| 564 |
| 565 if (is_linux) { |
| 566 test("breakpad_unittests") { |
| 567 sources = [ |
| 568 "linux/breakpad_googletest_includes.h", |
| 569 "src/client/linux/handler/exception_handler_unittest.cc", |
| 570 "src/client/linux/minidump_writer/cpu_set_unittest.cc", |
| 571 "src/client/linux/minidump_writer/directory_reader_unittest.cc", |
| 572 "src/client/linux/minidump_writer/line_reader_unittest.cc", |
| 573 "src/client/linux/minidump_writer/linux_core_dumper_unittest.cc", |
| 574 "src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc", |
| 575 "src/client/linux/minidump_writer/minidump_writer_unittest.cc", |
| 576 "src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc", |
| 577 "src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc", |
| 578 "src/common/linux/elf_core_dump_unittest.cc", |
| 579 "src/common/linux/file_id_unittest.cc", |
| 580 "src/common/linux/linux_libc_support_unittest.cc", |
| 581 "src/common/linux/synth_elf.cc", |
| 582 "src/common/linux/tests/auto_testfile.h", |
| 583 "src/common/linux/tests/crash_generator.cc", |
| 584 "src/common/linux/tests/crash_generator.h", |
| 585 "src/common/memory_range.h", |
| 586 "src/common/memory_unittest.cc", |
| 587 "src/common/simple_string_dictionary_unittest.cc", |
| 588 "src/common/test_assembler.cc", |
| 589 "src/common/tests/file_utils.cc", |
| 590 "src/common/tests/file_utils.h", |
| 591 "src/tools/linux/md2core/minidump_memory_range.h", |
| 592 "src/tools/linux/md2core/minidump_memory_range_unittest.cc", |
| 593 ] |
| 594 |
| 595 deps = [ |
| 596 ":client", |
| 597 ":processor_support", |
| 598 ":linux_dumper_unittest_helper", |
| 599 "//testing/gtest", |
| 600 "//testing/gtest:gtest_main", |
| 601 "//testing/gmock", |
| 602 ] |
| 603 |
| 604 include_dirs = [ |
| 605 "linux", # Use our copy of breakpad_googletest_includes.h |
| 606 "src", |
| 607 ".", |
| 608 ] |
| 609 |
| 610 # There are some warnings in this code. |
| 611 configs -= [ "//build/config/compiler:chromium_code" ] |
| 612 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 613 |
| 614 if (is_clang) { |
| 615 # See http://crbug.com/138571#c18 |
| 616 cflags = [ "-Wno-unused-value" ] |
| 617 } |
| 618 |
| 619 if (is_android) { |
| 620 sources += [ "src/common/android/breakpad_getcontext_unittest.cc" ] |
| 621 libs = [ "log" ] |
| 622 include_dirs += [ "src/common/android/include" ] |
| 623 isolate_file = "breakpad_unittests.isolate" |
| 624 } |
| 625 } |
| 626 |
| 627 executable("linux_dumper_unittest_helper") { |
| 628 testonly = true |
| 629 sources = [ |
| 630 "src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc", |
| 631 ] |
| 632 deps = [ |
| 633 ":processor_support", |
| 634 ] |
| 635 |
| 636 include_dirs = [ "src" ] |
| 637 |
| 638 if (current_cpu == "mipsel" && is_android) { |
| 639 include_dirs += [ "src/common/android/include" ] |
| 640 } |
| 641 } |
| 642 |
| 643 executable("generate_test_dump") { |
| 644 testonly = true |
| 645 sources = [ |
| 646 "linux/generate-test-dump.cc", |
| 647 ] |
| 648 |
| 649 # This file has an unused variable warning. |
| 650 configs -= [ "//build/config/compiler:chromium_code" ] |
| 651 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 652 |
| 653 deps = [ |
| 654 ":client", |
| 655 ] |
| 656 |
| 657 include_dirs = [ "src" ] |
| 658 |
| 659 if (is_android) { |
| 660 libs = [ "log" ] |
| 661 include_dirs += [ "src/common/android/include" ] |
| 662 } |
| 663 } |
| 664 |
| 665 executable("minidump-2-core") { |
| 666 sources = [ |
| 667 "src/tools/linux/md2core/minidump-2-core.cc", |
| 668 ] |
| 669 |
| 670 include_dirs = [ "src" ] |
| 671 |
| 672 deps = [ |
| 673 ":client", |
| 674 ] |
| 675 } |
| 676 |
| 677 executable("core-2-minidump") { |
| 678 sources = [ |
| 679 "src/tools/linux/core2md/core2md.cc", |
| 680 ] |
| 681 |
| 682 deps = [ |
| 683 ":client", |
| 684 ] |
| 685 |
| 686 include_dirs = [ "src" ] |
| 687 } |
| 688 } |
| 689 |
| 690 if (is_ios) { |
| 691 static_library("client") { |
| 692 sources = [ |
| 693 "src/client/ios/Breakpad.h", |
| 694 "src/client/ios/Breakpad.mm", |
| 695 "src/client/ios/BreakpadController.h", |
| 696 "src/client/ios/BreakpadController.mm", |
| 697 "src/client/ios/handler/ios_exception_minidump_generator.h", |
| 698 "src/client/ios/handler/ios_exception_minidump_generator.mm", |
| 699 "src/client/mac/crash_generation/ConfigFile.h", |
| 700 "src/client/mac/crash_generation/ConfigFile.mm", |
| 701 "src/client/mac/handler/breakpad_nlist_64.cc", |
| 702 "src/client/mac/handler/breakpad_nlist_64.h", |
| 703 "src/client/mac/handler/dynamic_images.cc", |
| 704 "src/client/mac/handler/dynamic_images.h", |
| 705 "src/client/mac/handler/exception_handler.cc", |
| 706 "src/client/mac/handler/exception_handler.h", |
| 707 "src/client/mac/handler/minidump_generator.cc", |
| 708 "src/client/mac/handler/minidump_generator.h", |
| 709 "src/client/mac/handler/protected_memory_allocator.cc", |
| 710 "src/client/mac/handler/protected_memory_allocator.h", |
| 711 "src/client/mac/sender/uploader.h", |
| 712 "src/client/mac/sender/uploader.mm", |
| 713 "src/client/minidump_file_writer-inl.h", |
| 714 "src/client/minidump_file_writer.cc", |
| 715 "src/client/minidump_file_writer.h", |
| 716 "src/common/convert_UTF.c", |
| 717 "src/common/convert_UTF.h", |
| 718 "src/common/mac/HTTPMultipartUpload.m", |
| 719 "src/common/mac/file_id.cc", |
| 720 "src/common/mac/file_id.h", |
| 721 "src/common/mac/macho_id.cc", |
| 722 "src/common/mac/macho_id.h", |
| 723 "src/common/mac/macho_utilities.cc", |
| 724 "src/common/mac/macho_utilities.h", |
| 725 "src/common/mac/macho_walker.cc", |
| 726 "src/common/mac/macho_walker.h", |
| 727 "src/common/mac/string_utilities.cc", |
| 728 "src/common/mac/string_utilities.h", |
| 729 "src/common/md5.cc", |
| 730 "src/common/md5.h", |
| 731 "src/common/simple_string_dictionary.cc", |
| 732 "src/common/simple_string_dictionary.h", |
| 733 "src/common/string_conversion.cc", |
| 734 "src/common/string_conversion.h", |
| 735 "src/google_breakpad/common/minidump_format.h", |
| 736 ] |
| 737 |
| 738 include_dirs = [ |
| 739 "src", |
| 740 "src/client/mac/Framework", |
| 741 "src/common/mac", |
| 742 ] |
| 743 } |
| 744 # TODO(GYP) There is some XCode-only targets like ninja-breakpad. |
| 745 } |
| 746 |
| 747 if (is_win) { |
| 748 group("client") { |
| 749 public_configs = [ ":client_config" ] |
| 750 } |
| 751 |
| 752 source_set("breakpad_handler") { |
| 753 configs += [ ":handler_config" ] |
| 754 if (is_win) { |
| 755 public_configs = [ ":handler_config" ] |
| 756 } |
| 757 |
| 758 defines = [ "BREAKPAD_NO_TERMINATE_THREAD" ] |
| 759 |
| 760 sources = [ |
| 761 "src/client/windows/crash_generation/client_info.cc", |
| 762 "src/client/windows/crash_generation/client_info.h", |
| 763 "src/client/windows/crash_generation/crash_generation_client.cc", |
| 764 "src/client/windows/crash_generation/crash_generation_client.h", |
| 765 "src/client/windows/crash_generation/crash_generation_server.cc", |
| 766 "src/client/windows/crash_generation/crash_generation_server.h", |
| 767 "src/client/windows/crash_generation/minidump_generator.cc", |
| 768 "src/client/windows/crash_generation/minidump_generator.h", |
| 769 "src/client/windows/handler/exception_handler.cc", |
| 770 "src/client/windows/handler/exception_handler.h", |
| 771 "src/common/windows/guid_string.cc", |
| 772 "src/common/windows/guid_string.h", |
| 773 "src/common/windows/string_utils-inl.h", |
| 774 "src/google_breakpad/common/minidump_format.h", |
| 775 ] |
| 776 config("breakpad_handler_warnings") { |
| 777 if (is_clang) { |
| 778 # See https://code.google.com/p/google-breakpad/issues/detail?id=658. |
| 779 cflags = [ "-Wno-reorder" ] |
| 780 } |
| 781 } |
| 782 |
| 783 configs += [ ":breakpad_handler_warnings" ] |
| 784 } |
| 785 |
| 786 source_set("breakpad_sender") { |
| 787 sources = [ |
| 788 "src/client/windows/sender/crash_report_sender.cc", |
| 789 "src/client/windows/sender/crash_report_sender.h", |
| 790 "src/common/windows/http_upload.cc", |
| 791 "src/common/windows/http_upload.h", |
| 792 ] |
| 793 configs += [ ":sender_config" ] |
| 794 public_configs = [ ":sender_config" ] |
| 795 } |
| 796 } |
OLD | NEW |