1#
2#  Copyright 2018 The Android Open Source Project
3#
4#  Licensed under the Apache License, Version 2.0 (the "License");
5#  you may not use this file except in compliance with the License.
6#  You may obtain a copy of the License at:
7#
8#  http://www.apache.org/licenses/LICENSE-2.0
9#
10#  Unless required by applicable law or agreed to in writing, software
11#  distributed under the License is distributed on an "AS IS" BASIS,
12#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13#  See the License for the specific language governing permissions and
14#  limitations under the License.
15#
16
17static_library("common") {
18  sources = [
19    "address_obfuscator.cc",
20    "message_loop_thread.cc",
21    "metric_id_allocator.cc",
22    "metrics_linux.cc",
23    "os_utils.cc",
24    "repeating_timer.cc",
25    "stop_watch_legacy.cc",
26    "time_util.cc",
27  ]
28
29  include_dirs = [
30    "//bt/system/",
31    "//bt/system/stack/include",
32    "//bt/system/linux_include",
33  ]
34
35  deps = [
36    "//bt/system:libbt-platform-protos-lite",
37  ]
38
39  configs += [
40    "//bt/system:target_defaults",
41    "//bt/system/log:log_defaults",
42  ]
43}
44
45if (use.test) {
46  executable("bluetooth_test_common") {
47    sources = [
48      "leaky_bonded_queue_unittest.cc",
49      "state_machine_unittest.cc",
50      "time_util_unittest.cc",
51    ]
52
53    include_dirs = [
54      "//bt/system/",
55      "//bt/system/common",
56    ]
57
58    deps = [ "//bt/system/common" ]
59
60    configs += [
61      "//bt/system:external_gtest_main",
62      "//bt/system:external_gmock_main",
63      "//bt/system:target_defaults",
64      "//bt/system/log:log_defaults",
65    ]
66
67    libs = [
68      "pthread",
69      "rt",
70    ]
71  }
72}
73