Linux build fix
Test: build on linux using ninja
Change-Id: I3b0102814433ca88611fbc863271fe065d443c68
diff --git a/btcore/BUILD.gn b/btcore/BUILD.gn
index dc4da9e..01d5ec1 100644
--- a/btcore/BUILD.gn
+++ b/btcore/BUILD.gn
@@ -16,7 +16,6 @@
static_library("btcore") {
sources = [
- "src/bdaddr.cc",
"src/device_class.cc",
"src/hal_util.cc",
"src/module.cc",
@@ -52,6 +51,7 @@
deps = [
"//btcore",
"//osi",
+ "//types",
"//third_party/googletest:gtest_main",
"//third_party/libchrome:base",
]
diff --git a/btif/src/btif_a2dp_source.cc b/btif/src/btif_a2dp_source.cc
index 6667687..dbb05ad 100644
--- a/btif/src/btif_a2dp_source.cc
+++ b/btif/src/btif_a2dp_source.cc
@@ -21,7 +21,9 @@
#define ATRACE_TAG ATRACE_TAG_AUDIO
#include <base/logging.h>
+#ifndef OS_GENERIC
#include <cutils/trace.h>
+#endif
#include <limits.h>
#include <string.h>
#include <algorithm>
@@ -663,7 +665,9 @@
CHECK(btif_a2dp_source_cb.encoder_interface != NULL);
size_t transmit_queue_length =
fixed_queue_length(btif_a2dp_source_cb.tx_audio_queue);
+#ifndef OS_GENERIC
ATRACE_INT("btif TX queue", transmit_queue_length);
+#endif
if (btif_a2dp_source_cb.encoder_interface->set_transmit_queue_length !=
NULL) {
btif_a2dp_source_cb.encoder_interface->set_transmit_queue_length(
diff --git a/build/BUILD.gn b/build/BUILD.gn
index ebebf3d..af7d5d8 100644
--- a/build/BUILD.gn
+++ b/build/BUILD.gn
@@ -17,6 +17,7 @@
config("default_include_dirs") {
include_dirs = [
"//third_party/libhardware/include/",
+ "//types/",
]
}
diff --git a/service/BUILD.gn b/service/BUILD.gn
index ae8153a..2ad2982 100644
--- a/service/BUILD.gn
+++ b/service/BUILD.gn
@@ -57,7 +57,8 @@
]
deps = [
- "//third_party/libchrome:base"
+ "//types",
+ "//third_party/libchrome:base",
]
}
diff --git a/stack/BUILD.gn b/stack/BUILD.gn
index 0be4333..9e386ab 100644
--- a/stack/BUILD.gn
+++ b/stack/BUILD.gn
@@ -178,6 +178,7 @@
]
deps = [
+ "//types",
"//third_party/libchrome:base",
"//third_party/libldac:libldacBT_enc",
"//third_party/libldac:libldacBT_abr",
@@ -225,6 +226,7 @@
"//device",
"//embdrv/sbc",
"//hci",
+ "//types",
"//main:bluetooth.default",
"//third_party/googletest:gmock_main",
"//third_party/libchrome:base",
@@ -247,7 +249,7 @@
"//stack/btm",
]
-libs = [
+ libs = [
"-ldl",
"-lpthread",
"-lresolv",
@@ -257,6 +259,7 @@
]
deps = [
+ "//types",
"//third_party/googletest:gmock_main",
"//third_party/libchrome:base",
]
diff --git a/stack/a2dp/a2dp_vendor_ldac_encoder.cc b/stack/a2dp/a2dp_vendor_ldac_encoder.cc
index 47f7764..4ca3cdf 100644
--- a/stack/a2dp/a2dp_vendor_ldac_encoder.cc
+++ b/stack/a2dp/a2dp_vendor_ldac_encoder.cc
@@ -19,7 +19,9 @@
#include "a2dp_vendor_ldac_encoder.h"
+#ifndef OS_GENERIC
#include <cutils/trace.h>
+#endif
#include <dlfcn.h>
#include <inttypes.h>
#include <stdio.h>
@@ -547,7 +549,9 @@
a2dp_ldac_encoder_cb.TxQueueLength, flag_enable);
if (prev_eqmid != a2dp_ldac_encoder_cb.last_ldac_abr_eqmid)
a2dp_ldac_encoder_cb.ldac_abr_adjustments++;
+#ifndef OS_GENERIC
ATRACE_INT("LDAC ABR level", a2dp_ldac_encoder_cb.last_ldac_abr_eqmid);
+#endif
}
// Transcode frame and enqueue
a2dp_ldac_encode_frames(nb_frame);
diff --git a/test/suite/BUILD.gn b/test/suite/BUILD.gn
index e413eb0..d481000 100644
--- a/test/suite/BUILD.gn
+++ b/test/suite/BUILD.gn
@@ -31,6 +31,7 @@
"//main:bluetooth.default",
"//service:service",
"//service:service_unittests",
+ "//types:types_unittests",
"//third_party/libchrome:base",
"//osi",
"//third_party/googletest:gtest_main",
diff --git a/tools/mcap_tool/BUILD.gn b/tools/mcap_tool/BUILD.gn
index a5fef31..a3f18eb 100644
--- a/tools/mcap_tool/BUILD.gn
+++ b/tools/mcap_tool/BUILD.gn
@@ -39,5 +39,6 @@
"//btcore",
"//osi",
"//third_party/libchrome:base",
+ "//types",
]
}
diff --git a/types/BUILD.gn b/types/BUILD.gn
new file mode 100644
index 0000000..6b18806
--- /dev/null
+++ b/types/BUILD.gn
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2017 Google, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+static_library("types") {
+ cflags = [
+ "-fvisibility=default",
+ ]
+
+ sources = [
+ "raw_address.cc",
+ ]
+
+ include_dirs = [
+ "//",
+ ]
+
+ deps = [
+ "//third_party/libchrome:base",
+ ]
+}
+
+executable("types_unittests") {
+ testonly = true
+ sources = [
+ "test/raw_address_unittest.cc",
+ ]
+
+ include_dirs = [
+ "//",
+ ]
+
+ libs = [
+ "-ldl",
+ "-lpthread",
+ "-lresolv",
+ "-lrt",
+ "-lz",
+ "-latomic",
+ ]
+
+ deps = [
+ "//types",
+ "//third_party/googletest:gmock_main",
+ "//third_party/libchrome:base",
+ ]
+}