| # Copyright 2023 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//base/allocator/allocator.gni") |
| import("//base/debug/debug.gni") |
| import("//build/buildflag_header.gni") |
| import("//build/config/compiler/compiler.gni") |
| import("//build/config/compiler/pgo/pgo.gni") |
| import("//components/gwp_asan/buildflags/buildflags.gni") |
| |
| # We use a source set instead of a component. Using a component leads to |
| # duplicate symbols when creating a component build. |
| source_set("memory_system") { |
| sources = [ |
| "initializer.cc", |
| "initializer.h", |
| "memory_system.cc", |
| "memory_system.h", |
| "memory_system_features.cc", |
| "memory_system_features.h", |
| "parameters.cc", |
| "parameters.h", |
| ] |
| |
| public_deps = [ |
| "//components/version_info", |
| "//third_party/abseil-cpp:absl", |
| ] |
| |
| deps = [ |
| "//base", |
| "//base/allocator:buildflags", |
| "//build/config/compiler:compiler_buildflags", |
| "//components/gwp_asan/buildflags", |
| "//components/sampling_profiler:profile_params", |
| ] |
| |
| if (enable_gwp_asan) { |
| deps += [ "//components/gwp_asan/client" ] |
| } |
| |
| # Regardless of `enable_gwp_asan`, we must depend directly |
| # on the presence of the `base::Feature` that governs it. This is |
| # because WebView depends on it, but support cannot be "compiled out" |
| # hinging on a buildflag. |
| if (is_android) { |
| deps += [ "//components/gwp_asan/client:features" ] |
| } |
| |
| is_heap_profiling_supported = !is_ios || use_allocator_shim |
| |
| if (is_heap_profiling_supported) { |
| deps += [ |
| "//components/heap_profiling/in_process", |
| "//components/services/heap_profiling/public/cpp", |
| ] |
| } |
| |
| if (build_allocation_stack_trace_recorder) { |
| deps += [ "//components/allocation_recorder/crash_client" ] |
| |
| if (build_allocation_trace_recorder_full_reporting) { |
| sources += [ |
| "allocation_trace_recorder_statistics_reporter.cc", |
| "allocation_trace_recorder_statistics_reporter.h", |
| ] |
| } |
| } |
| } |