#
#  Copyright 2015 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.
#

# This is the root build file for GN. GN will start processing by loading this
# file, and recursively load all dependencies until all dependencies are either
# resolved or known not to exist (which will cause the build to fail). So if
# you add a new build file, there must be some path of dependencies from this
# file to your new one or GN won't know about it.

group("all") {
  deps = [ ":bluetooth" ]

  #if (use.test) {
    #deps += [ ":bluetooth_tests" ]
  #}
}

# This pulls in main/BUILD.gn and all of its dependencies.
group("bluetooth") {
  deps = [
    "//bt/system/main:bluetooth",
    "//bt/system/main:bluetooth-static",
    #"//bt/system/service:bluetoothtbd",
  ]
}

# TODO(b/190750167) - Re-enable once we're fully Bazel build
#if (use.test) {
  #group("bluetooth_tests") {
    #deps = [
      #"//bt/system/btcore:net_test_btcore",
      #"//bt/system/common:bluetooth_test_common",
      #"//bt/system/profile/avrcp:net_test_avrcp",
      #"//bt/system/service:bluetoothtbd_test",
      #"//bt/system/stack:net_test_btm_iso",
      #"//bt/system/types:net_test_types",

      ##"//bt/system/packet:net_test_btpackets",
    #]
  #}
#}

group("tools") {
  deps = [
    "//bt/system/gd/dumpsys/bundler:bluetooth_flatbuffer_bundler",
    "//bt/system/gd/packet/parser:bluetooth_packetgen",
  ]
}

if (defined(use.android) && use.android) {
  group("android_bluetooth_tests") {
    deps = [
      "//bt/system/device:net_test_device",
      "//bt/system/hci:net_test_hci",
      "//bt/system/osi:net_test_osi",
      "//bt/system/test/suite:net_test_bluetooth",
    ]
  }
}

config("target_defaults") {
  include_dirs = [
    "//bt/system",
    "//bt/system/linux_include",
    "//bt/system/types",
    "//bt/system/include",

    # For flatbuffer generated headers
    "${root_gen_dir}/bt/system/gd/",
    "${root_gen_dir}/bt/system/gd/dumpsys/bundler",
  ]

  cflags = [
    "-fPIC",
    "-Wno-non-c-typedef-for-linkage",
    "-Wno-unreachable-code-return",
    "-Wno-defaulted-function-deleted",
    "-Wno-gnu-variable-sized-type-not-at-end",
    "-Wno-format-nonliteral",
    "-Wno-inconsistent-missing-override",
    "-Wno-unreachable-code",
    "-Wno-range-loop-construct",
    "-Wno-reorder-init-list",
    "-Wno-unused-function",
    "-Wno-unused-result",
    "-Wno-unused-variable",
    "-Wno-unused-const-variable",
    "-Wno-format",
    "-Wno-pessimizing-move",
    "-Wno-unknown-warning-option",
    "-Wno-final-dtor-non-final-class",

    string_join("", ["-ffile-prefix-map=", rebase_path(".", "${root_build_dir}", "."), "/= "])
  ]

  cflags_cc = [
    "-std=c++17",
  ]

  defines = [
    "HAS_NO_BDROID_BUILDCFG",
    "OS_GENERIC",
    "OS_LINUX_GENERIC",
    "TARGET_FLOSS",
    "EXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
    "FALLTHROUGH_INTENDED=[[clang::fallthrough]]",
    # TODO(b/214148074): Start with NB, should enable WB.
    "DISABLE_WBS=TRUE",
    # TODO(b/214149380): Start with Enhanced Call Status feature supported.
    # Should enable required features in the future.
    # This will be consumed by BTA_AgRegister and passed to HF through AT+BRSF.
    "BTIF_HF_FEATURES=0x00000040"
  ]

  if (!(defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs)) {
    defines += [ "EXCLUDE_NONSTANDARD_CODECS" ]
  }

  configs = [ ":external_libchrome" ]
}

group("libbt-platform-protos-lite") {
  deps = [
    "//external/proto_logging/stats/enums/bluetooth:libbt-platform-protos-lite",
  ]
}

# Configurations to use as dependencies for GN build
config("external_gtest") {
  configs = [
    ":pkg_gtest",
    ":pkg_gmock",
  ]
}

config("external_gtest_main") {
  configs = [ ":pkg_gtest_main" ]
}

config("external_gmock_main") {
  configs = [ ":pkg_gmock_main" ]
}

config("external_libchrome") {
  configs = [ ":pkg_libchrome" ]
}

config("external_modp_b64") {
  configs = [ ":pkg_modp_b64" ]
}

config("external_tinyxml2") {
  configs = [ ":pkg_tinyxml2" ]
}

config("external_flatbuffers") {
  lib_dirs = [ "${libdir}" ]

  libs = [ "flatbuffers" ]
}

# Package configurations to extract dependencies from env
pkg_config("pkg_gtest") {
  pkg_deps = [ "gtest" ]
}

pkg_config("pkg_gtest_main") {
  pkg_deps = [ "gtest_main" ]
}

pkg_config("pkg_gmock") {
  pkg_deps = [ "gmock" ]
}

pkg_config("pkg_gmock_main") {
  pkg_deps = [ "gmock_main" ]
}

pkg_config("pkg_libchrome") {
  pkg_deps = [ "libchrome" ]
}

pkg_config("pkg_modp_b64") {
  pkg_deps = [ "libmodp_b64" ]
}

pkg_config("pkg_tinyxml2") {
  pkg_deps = [ "tinyxml2" ]
}

# To use non-standard codecs (i.e. ldac, aac, aptx), set this use flag when
# building. These codecs may have licensing issues that need to be resolved
# first.
if (defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs) {
  config("external_aac") {
    configs = [ ":pkg_aac" ]
  }

  pkg_config("pkg_aac") {
    pkg_deps = [ "fdk-aac" ]
  }

  config("external_libldac") {
    configs = [
      ":pkg_libldacBT_enc",
      ":pkg_libldacBT_abr",
    ]
  }

  pkg_config("pkg_libldacBT_enc") {
    pkg_deps = [ "ldacBT-enc" ]
  }

  pkg_config("pkg_libldacBT_abr") {
    pkg_deps = [ "ldacBT-abr" ]
  }
}
