Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28550e91 authored by Arman Uguray's avatar Arman Uguray Committed by Miao Chou
Browse files

gn-build: Get bluetooth.default.so to compile

Now that most of the modules here are compiled in their own static libraries,
there is no need to include their sources from main/BUILD.gn. This CL cleans
this up and adds all the missing dependencies for the //main:bluetooth.default
shared library target. Missing includes and non-Android compile errors have
always been fixed.

BUG=21339022

Change-Id: Ibcc693d5ff17aa9c446db777d4b9fbb706f8c7dd
parent b3355aa6
Loading
Loading
Loading
Loading
+14 −68
Original line number Diff line number Diff line
@@ -29,68 +29,6 @@ shared_library("bluetooth.default") {
    "stack_config.c",
  ]

  # BTIF
  sources += [
    "//btif/src/btif_av.c",
    "//btif/src/btif_config.c",
    "//btif/src/btif_config_transcode.cpp",
    "//btif/src/btif_core.c",
    "//btif/src/btif_dm.c",
    "//btif/src/btif_gatt.c",
    "//btif/src/btif_gatt_client.c",
    "//btif/src/btif_gatt_multi_adv_util.c",
    "//btif/src/btif_gatt_server.c",
    "//btif/src/btif_gatt_test.c",
    "//btif/src/btif_gatt_util.c",
    "//btif/src/btif_hf.c",
    "//btif/src/btif_hf_client.c",
    "//btif/src/btif_hh.c",
    "//btif/src/btif_hl.c",
    "//btif/src/btif_mce.c",
    "//btif/src/btif_media_task.c",
    "//btif/src/btif_pan.c",
    "//btif/src/btif_profile_queue.c",
    "//btif/src/btif_rc.c",
    "//btif/src/btif_sm.c",
    "//btif/src/btif_sock.c",
    "//btif/src/btif_sock_rfc.c",
    "//btif/src/btif_sock_sco.c",
    "//btif/src/btif_sock_sdp.c",
    "//btif/src/btif_sock_thread.c",
    "//btif/src/btif_sock_util.c",
    "//btif/src/btif_storage.c",
    "//btif/src/btif_util.c",
    "//btif/src/stack_manager",
  ]

  # callouts
  sources += [
    "//btif/co/bta_ag_co.c",
    "//btif/co/bta_dm_co.c",
    "//btif/co/bta_av_co.c",
    "//btif/co/bta_hh_co.c",
    "//btif/co/bta_hl_co.c",
    "//btif/co/bta_pan_co.c",
    "//btif/co/bta_gattc_co.c",
    "//btif/co/bta_gatts_co.c",
  ]

  # sbc encoder
  sources += [
    "//embdrv/sbc/encoder/srce/sbc_analysis.c",
    "//embdrv/sbc/encoder/srce/sbc_dct.c",
    "//embdrv/sbc/encoder/srce/sbc_dct_coeffs.c",
    "//embdrv/sbc/encoder/srce/sbc_enc_bit_alloc_mono.c",
    "//embdrv/sbc/encoder/srce/sbc_enc_bit_alloc_ste.c",
    "//embdrv/sbc/encoder/srce/sbc_enc_coeffs.c",
    "//embdrv/sbc/encoder/srce/sbc_encoder.c",
    "//embdrv/sbc/encoder/srce/sbc_packing.c",
  ]

  sources += [
    "//udrv/ulinux/uipc.c",
  ]

  include_dirs = [
    "//",
    "//bta/include",
@@ -121,25 +59,33 @@ shared_library("bluetooth.default") {
  ]

  deps = [
    "//audio_a2dp_hw:audio.a2dp.default",
    "//bta",
    "//gki",
    "//stack",
    "//btcore",
    "//btif",
    "//device",
    "//embdrv/sbc",
    "//gki",
    "//hci",
    "//utils",
    "//btcore",
    "//osi",
    # TODO tinyxml2
    # TODO qcom sbc decoder
    "//stack",
    "//third_party/tinyxml2",
    "//udrv",
    "//utils",
  ]

  # TODO(armansito): Remove all of the flags below, as we want to be able to
  # compile the source code with as many warnings enabled as possible.
  cflags = [
    "-Wno-unused-variable",
    "-Wno-unused-value",
    "-Wno-unused-function",
    "-Wno-int-to-pointer-cast",
  ]

  cflags_c = [
    "-Wno-pointer-to-int-cast",
  ]

  libs = [ "-lpthread", "-lrt", "-ldl" ]
}
+9 −0
Original line number Diff line number Diff line
@@ -59,10 +59,19 @@
#include "smp_api.h"
#endif

// TODO(armansito): Work-around until we figure out a way to generate logs in a
// platform-independent manner.
#if defined(OS_GENERIC)
#define LOGI0(t,s) fprintf(stderr, "%s\n", s)
#define LOGD0(t,s) fprintf(stderr, "%s\n", s)
#define LOGW0(t,s) fprintf(stderr, "%s\n", s)
#define LOGE0(t,s) fprintf(stderr, "%s\n", s)
#else  // !defined(OS_GENERIC)
#define LOGI0(t,s) __android_log_write(ANDROID_LOG_INFO, t, s)
#define LOGD0(t,s) __android_log_write(ANDROID_LOG_DEBUG, t, s)
#define LOGW0(t,s) __android_log_write(ANDROID_LOG_WARN, t, s)
#define LOGE0(t,s) __android_log_write(ANDROID_LOG_ERROR, t, s)
#endif  // defined(OS_GENERIC)

#ifndef DEFAULT_CONF_TRACE_LEVEL
#define DEFAULT_CONF_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
+0 −1
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@
#define LOG_TAG "bt_main"

#include <assert.h>
#include <cutils/properties.h>
#include <fcntl.h>
#include <hardware/bluetooth.h>
#include <pthread.h>