summaryrefslogtreecommitdiffstats
path: root/base/debug/BUILD.gn
blob: eb2a3097332f274726a2852907a4bc37e1aa0310 (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
# Copyright (c) 2015 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("//build/buildflag_header.gni")
import("//build/config/compiler/compiler.gni")

# Should be static library, see documentation on //base:base for discussion.
static_library("debug") {
  sources = [
    "alias.cc",
    "alias.h",
    "asan_invalid_access.cc",
    "asan_invalid_access.h",
    "close_handle_hook_win.cc",
    "close_handle_hook_win.h",
    "crash_logging.cc",
    "crash_logging.h",
    "debugger.cc",
    "debugger.h",
    "debugger_posix.cc",
    "debugger_win.cc",
    "dump_without_crashing.cc",
    "dump_without_crashing.h",
    "gdi_debug_util_win.cc",
    "gdi_debug_util_win.h",

    # This file depends on files from the "allocator" target,
    # but this target does not depend on "allocator" (see
    # allocator.gyp for details).
    "leak_annotations.h",
    "leak_tracker.h",
    "proc_maps_linux.cc",
    "proc_maps_linux.h",
    "profiler.cc",
    "profiler.h",
    "stack_trace.cc",
    "stack_trace.h",
    "stack_trace_android.cc",
    "stack_trace_posix.cc",
    "stack_trace_win.cc",
    "task_annotator.cc",
    "task_annotator.h",
  ]

  if (is_android) {
    # Android uses some Linux sources, put those back.
    set_sources_assignment_filter([])
    sources += [ "proc_maps_linux.cc" ]
    set_sources_assignment_filter(sources_assignment_filter)

    sources -= [ "stack_trace_posix.cc" ]
  }

  if (is_nacl) {
    sources -= [
      "crash_logging.cc",
      "crash_logging.h",
      "stack_trace.cc",
      "stack_trace_posix.cc",
    ]
  }

  configs += [ "//base:base_implementation" ]

  deps = [
    ":debugging_flags",
    "//base:base_static",
    "//base/memory",
    "//base/process",
  ]

  if (is_linux) {
    defines = [ "USE_SYMBOLIZE" ]
    deps += [ "//base/third_party/symbolize" ]
  }

  allow_circular_includes_from = [
    "//base/memory",
    "//base/process",
  ]

  visibility = [ "//base/*" ]
}

buildflag_header("debugging_flags") {
  header = "debugging_flags.h"

  flags = [ "ENABLE_PROFILING=$enable_profiling" ]
}