xref: /aosp_15_r20/external/webrtc/rtc_base/memory/BUILD.gn (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS.  All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9import("../../webrtc.gni")
10if (is_android) {
11  import("//build/config/android/config.gni")
12  import("//build/config/android/rules.gni")
13}
14
15rtc_library("aligned_malloc") {
16  sources = [
17    "aligned_malloc.cc",
18    "aligned_malloc.h",
19  ]
20  deps = [ "..:checks" ]
21}
22
23# Test only utility.
24rtc_library("fifo_buffer") {
25  testonly = true
26  visibility = [
27    ":unittests",
28    "..:rtc_base_tests_utils",
29    "..:rtc_base_unittests",
30  ]
31  sources = [
32    "fifo_buffer.cc",
33    "fifo_buffer.h",
34  ]
35  deps = [
36    "..:rtc_base",
37    "..:threading",
38    "../../api/task_queue:pending_task_safety_flag",
39    "../synchronization:mutex",
40  ]
41}
42
43rtc_library("unittests") {
44  testonly = true
45  sources = [
46    "aligned_malloc_unittest.cc",
47    "always_valid_pointer_unittest.cc",
48    "fifo_buffer_unittest.cc",
49  ]
50  deps = [
51    ":aligned_malloc",
52    ":always_valid_pointer",
53    ":fifo_buffer",
54    "../../test:test_support",
55  ]
56}
57
58rtc_source_set("always_valid_pointer") {
59  sources = [ "always_valid_pointer.h" ]
60  deps = [ "..:checks" ]
61}
62