# Copyright (c) 2020 Project CHIP Authors
#
# 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.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/mbedtls.gni")
import("//build_overrides/nlassert.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/nlunit_test.gni")
import("//build_overrides/pigweed.gni")

import("//src/lwip/lwip.gni")
import("//src/platform/device.gni")
import("$dir_pw_build/python.gni")

# This build file should not be used in superproject builds.
assert(chip_root == "//")

import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/build/chip/tools.gni")

import("//src/crypto/crypto.gni")

if (current_toolchain != "${dir_pw_toolchain}/default:default") {
  declare_args() {
    chip_enable_python_modules =
        (current_os == "mac" || current_os == "linux") &&
        (host_cpu == "x64" || host_cpu == "arm64")
    enable_pylib = false
  }

  # Python packages for supporting specific targets.
  pw_python_group("python_packages") {
    python_deps = [
      "$dir_pw_build/py",
      "$dir_pw_doctor/py",
      "$dir_pw_env_setup/py",
      "$dir_pw_hdlc/py",
      "$dir_pw_module/py",
      "$dir_pw_protobuf/py",
      "$dir_pw_protobuf_compiler/py",
      "$dir_pw_rpc/py",
      "$dir_pw_status/py",
      "$dir_pw_toolchain/py",
      "$dir_pw_unit_test/py",
      "$dir_pw_watch/py",
      "integrations/mobly:chip_mobly",
      "scripts:requirements",
      "third_party/happy",
    ]
  }

  # This is a real toolchain. Build CHIP.
  group("default") {
    deps = [
      "${chip_root}/src/app",
      "${chip_root}/src/ble",
      "${chip_root}/src/channel",
      "${chip_root}/src/controller",
      "${chip_root}/src/credentials",
      "${chip_root}/src/crypto",
      "${chip_root}/src/inet",
      "${chip_root}/src/lib",
      "${chip_root}/src/lib/asn1",
      "${chip_root}/src/lib/core",
      "${chip_root}/src/lib/support",
      "${chip_root}/src/messaging",
      "${chip_root}/src/protocols",
      "${chip_root}/src/setup_payload",
      "${chip_root}/src/system",
      "${chip_root}/src/transport",
      "${mbedtls_root}:mbedtls",
      "${nlassert_root}:nlassert",
      "${nlio_root}:nlio",
      "${nlunit_test_root}:nlunit-test",
    ]

    if (chip_device_platform != "none") {
      deps += [ "${chip_root}/src/app/server" ]
    }

    if (chip_build_tests) {
      deps += [ "//src:tests" ]
      if (current_os == "android") {
        deps += [ "${chip_root}/build/chip/java/tests:java_build_test" ]
      }
    }

    if (chip_with_lwip) {
      deps += [ "${chip_root}/src/lwip" ]
    }

    if (chip_build_tools) {
      deps += [
        ":certification",
        "${chip_root}/examples/shell/standalone:chip-shell",
        "${chip_root}/src/app/tests/integration:chip-im-initiator",
        "${chip_root}/src/app/tests/integration:chip-im-responder",
        "${chip_root}/src/messaging/tests/echo:chip-echo-requester",
        "${chip_root}/src/messaging/tests/echo:chip-echo-responder",
        "${chip_root}/src/qrcodetool",
        "${chip_root}/src/setup_payload",
      ]
      if (chip_crypto == "openssl") {
        deps += [ "${chip_root}/src/tools/chip-cert" ]
      }
      if (chip_enable_python_modules) {
        if (enable_pylib) {
          deps += [ "${chip_root}/src/pybindings/pycontroller" ]
        }
        deps += [ "${chip_root}/src/controller/python" ]
      }
    }

    if (current_os == "android") {
      deps += [
        "${chip_root}/src/app/server/java",
        "${chip_root}/src/controller/java",
        "${chip_root}/src/platform/android:java",
        "${chip_root}/src/setup_payload/java",
      ]
    }
  }

  if (chip_build_tools) {
    group("certification") {
      data_deps = [ "${chip_root}/examples/chip-tool" ]

      if (chip_enable_python_modules) {
        if (enable_pylib) {
          data_deps += [ "${chip_root}/src/pybindings/pycontroller" ]
        }
        data_deps += [ "${chip_root}/src/controller/python" ]
      }

      write_runtime_deps = "${root_out_dir}/certification.runtime_deps"
    }
  }

  group("fake_platform_tests") {
    if (chip_link_tests) {
      deps = [ "//src:fake_platform_tests_run" ]
    }
  }

  group("check") {
    if (chip_link_tests) {
      deps = [
        "//:fake_platform_tests",
        "//scripts/build:build_examples.tests",
        "//src:tests_run",
      ]
    }
  }

  # We don't always want to run happy tests, make them a seperate group.
  if (chip_enable_happy_tests) {
    group("happy_tests") {
      if (chip_link_tests) {
        deps = [ "//src:happy_tests" ]
      }
    }
  }
} else {
  # This is the unified build. Configure various real toolchains.
  import("${chip_root}/build/chip/chip_build.gni")
  declare_args() {
    # Set this to false to disable all builds by default.
    enable_default_builds = true

    # Enable building for Android.
    enable_android_builds = false

    # Set this to true to enable TI builds by default.
    enable_ti_simplelink_builds = false

    # Set this to true to enable efr32 builds by default.
    enable_efr32_builds = false

    # Set this to true to enable p6 builds by default.
    enable_p6_builds = false

    # Set this to true to enable Qorvo qpg builds by default.
    enable_qpg_builds = false

    # Set this to true to enable k32w builds by default.
    enable_k32w_builds = false
  }

  declare_args() {
    # Enable building chip with clang.
    enable_host_clang_build = enable_default_builds && host_os != "win"

    # Enable building chip with gcc.
    enable_host_gcc_build = enable_default_builds && host_os != "win"

    # Enable building chip with gcc & mbedtls.
    enable_host_gcc_mbedtls_build = enable_default_builds && host_os != "win"

    # Build the chip-cert tool.
    enable_standalone_chip_cert_build =
        enable_default_builds && host_os != "win" && chip_crypto == "openssl"

    # Build the chip-tool example.
    enable_standalone_chip_tool_build =
        enable_default_builds && host_os != "win"

    # Build the chip-tool-darwin example.
    enable_standalone_chip_tool_darwin_build =
        enable_default_builds && host_os == "mac"

    # Build the shell example.
    enable_standalone_shell_build = enable_default_builds && host_os != "win"

    # Build the Linux all clusters app example.
    enable_linux_all_clusters_app_build =
        enable_default_builds && (host_os == "linux" || host_os == "mac")

    # Build the Linux tv app example.
    enable_linux_tv_app_build =
        enable_default_builds && (host_os == "linux" || host_os == "mac")

    # Build the Linux tv casting app example.
    enable_linux_tv_casting_app_build =
        enable_default_builds && (host_os == "linux" || host_os == "mac")

    # Build the Linux bridge app example.
    enable_linux_bridge_app_build =
        enable_default_builds && (host_os == "linux" || host_os == "mac")

    # Build the Linux lighting app example.
    enable_linux_lighting_app_build =
        enable_default_builds && (host_os == "linux" || host_os == "mac")

    # Build the Linux thermostat app example.
    enable_linux_thermostat_app_build =
        enable_default_builds && (host_os == "linux" || host_os == "mac")

    # Build the cc13x2x7_26x2x7 lock app example.
    enable_cc13x2x7_26x2x7_lock_app_build = enable_ti_simplelink_builds

    # Build the efr32 lock app example.
    enable_efr32_lock_app_build = enable_efr32_builds

    # Build the p6 lock app example.
    enable_p6_lock_app_build = enable_p6_builds

    # Build the qpgxxxx lock app example.
    enable_qpg_lock_app_build = enable_qpg_builds && !is_debug

    # Build the efr32 lighting app example.
    enable_efr32_lighting_app_build = enable_efr32_builds

    # Build the efr32 window app example.
    enable_efr32_window_app_build = enable_efr32_builds

    # Build the k32w lighting app example.
    enable_k32w_lighting_app_build = enable_k32w_builds

    # Build the k32w lock app example.
    enable_k32w_lock_app_build = enable_k32w_builds

    # Build the k32w shell app example.
    enable_k32w_shell_app_build = enable_k32w_builds

    enable_fake_tests = enable_default_builds && host_os == "linux"
  }

  if (enable_host_clang_build) {
    chip_build("host_clang") {
      toolchain = "${build_root}/toolchain/host:${host_os}_${host_cpu}_clang"
    }
  }

  if (enable_host_gcc_build) {
    chip_build("host_gcc") {
      toolchain = "${build_root}/toolchain/host:${host_os}_${host_cpu}_gcc"
    }
  }

  if (enable_host_gcc_mbedtls_build) {
    chip_build("host_gcc_mbedtls") {
      toolchain = "${chip_root}/config/mbedtls/toolchain:${host_os}_${host_cpu}_gcc_mbedtls"
    }
  }

  if (enable_android_builds) {
    chip_build("android_arm") {
      toolchain = "${build_root}/toolchain/android:android_arm"
    }

    chip_build("android_arm64") {
      toolchain = "${build_root}/toolchain/android:android_arm64"
    }

    chip_build("android_x64") {
      toolchain = "${build_root}/toolchain/android:android_x64"
    }

    chip_build("android_x86") {
      toolchain = "${build_root}/toolchain/android:android_x86"
    }
  }

  if (enable_fake_tests) {
    chip_build("fake_platform") {
      toolchain = "${build_root}/toolchain/fake:fake_${host_cpu}_gcc"
    }
  }

  standalone_toolchain = "${chip_root}/config/standalone/toolchain:standalone"
  not_needed([ "standalone_toolchain" ])  # Might not be needed.

  if (enable_standalone_chip_cert_build) {
    group("standalone_chip_cert") {
      deps = [ "${chip_root}/src/tools/chip-cert(${standalone_toolchain})" ]
    }
  }

  if (enable_standalone_chip_tool_build) {
    group("standalone_chip_tool") {
      deps = [ "${chip_root}/examples/chip-tool(${standalone_toolchain})" ]
    }
  }

  if (enable_standalone_chip_tool_darwin_build) {
    group("standalone_chip_tool_darwin") {
      deps =
          [ "${chip_root}/examples/chip-tool-darwin(${standalone_toolchain})" ]
    }
  }

  if (enable_cc13x2x7_26x2x7_lock_app_build) {
    group("cc13x2x7_26x2x7_lock_app") {
      deps = [ "${chip_root}/examples/lock-app/cc13x2x7_26x2x7(${chip_root}/config/cc13x2_26x2/toolchain:cc13x2x7_26x2x7_lock_app)" ]
    }
  }

  if (enable_standalone_shell_build) {
    group("standalone_shell") {
      deps =
          [ "${chip_root}/examples/shell/standalone(${standalone_toolchain})" ]
    }
  }

  if (enable_linux_all_clusters_app_build) {
    group("linux_all_clusters_app") {
      deps = [
        "${chip_root}/examples/all-clusters-app/linux(${standalone_toolchain})",
      ]
    }
  }

  if (enable_linux_thermostat_app_build) {
    group("linux_thermostat_app") {
      deps =
          [ "${chip_root}/examples/thermostat/linux(${standalone_toolchain})" ]
    }
  }

  if (enable_linux_tv_app_build) {
    group("linux_tv_app") {
      deps = [ "${chip_root}/examples/tv-app/linux(${standalone_toolchain})" ]
    }
  }

  if (enable_linux_tv_casting_app_build) {
    group("linux_tv_casting_app") {
      deps = [
        "${chip_root}/examples/tv-casting-app/linux(${standalone_toolchain})",
      ]
    }
  }

  if (enable_linux_bridge_app_build) {
    group("linux_bridge_app") {
      deps =
          [ "${chip_root}/examples/bridge-app/linux(${standalone_toolchain})" ]
    }
  }

  if (enable_linux_lighting_app_build) {
    group("linux_lighting_app") {
      deps = [
        "${chip_root}/examples/lighting-app/linux(${standalone_toolchain})",
      ]
    }
  }

  if (enable_efr32_lock_app_build) {
    group("efr32_lock_app") {
      deps = [ "${chip_root}/examples/lock-app/efr32(${chip_root}/config/efr32/toolchain:efr32_lock_app)" ]
    }
  }

  if (enable_p6_lock_app_build) {
    group("p6_lock_app") {
      deps = [ "${chip_root}/examples/lock-app/p6(${chip_root}/config/p6/toolchain:p6_lock_app)" ]
    }
  }

  if (enable_qpg_lock_app_build) {
    group("qpg_lock_app") {
      deps = [ "${chip_root}/examples/lock-app/qpg(${chip_root}/config/qpg/toolchain:qpg_lock_app)" ]
    }
  }

  if (enable_efr32_lighting_app_build) {
    group("efr32_lighting_app") {
      deps = [ "${chip_root}/examples/lighting-app/efr32(${chip_root}/config/efr32/toolchain:efr32_lighting_app)" ]
    }
  }

  if (enable_efr32_window_app_build) {
    group("efr32_window_app") {
      deps = [ "${chip_root}/examples/window-app/efr32(${chip_root}/config/efr32/toolchain:efr32_window_app)" ]
    }
  }

  if (enable_k32w_lighting_app_build) {
    group("k32w_lighting_app") {
      deps = [ "${chip_root}/examples/lighting-app/k32w(${chip_root}/config/k32w/toolchain:k32w_lighting_app)" ]
    }
  }

  if (enable_k32w_lock_app_build) {
    group("k32w_lock_app") {
      deps = [ "${chip_root}/examples/lock-app/k32w(${chip_root}/config/k32w/toolchain:k32w_lock_app)" ]
    }
  }

  if (enable_k32w_shell_app_build) {
    group("k32w_shell_app") {
      deps = [ "${chip_root}/examples/shell/k32w(${chip_root}/config/k32w/toolchain:k32w_shell_app)" ]
    }
  }

  group("default") {
    deps = []
    if (enable_host_clang_build) {
      deps += [ ":host_clang" ]
    }
    if (enable_host_gcc_build) {
      deps += [ ":host_gcc" ]
    }
    if (enable_host_gcc_mbedtls_build) {
      deps += [ ":host_gcc_mbedtls" ]
    }
    if (enable_android_builds) {
      deps += [
        ":android_arm",
        ":android_arm64",
        ":android_x64",
        ":android_x86",
      ]
    }
    if (enable_standalone_chip_cert_build) {
      deps += [ ":standalone_chip_cert" ]
    }
    if (enable_standalone_chip_tool_build) {
      deps += [ ":standalone_chip_tool" ]
    }
    if (enable_standalone_chip_tool_darwin_build) {
      deps += [ ":standalone_chip_tool_darwin" ]
    }
    if (enable_standalone_shell_build) {
      deps += [ ":standalone_shell" ]
    }
    if (enable_linux_all_clusters_app_build) {
      deps += [ ":linux_all_clusters_app" ]
    }
    if (enable_linux_thermostat_app_build) {
      deps += [ ":linux_thermostat_app" ]
    }
    if (enable_linux_tv_app_build) {
      deps += [ ":linux_tv_app" ]
    }
    if (enable_linux_tv_casting_app_build) {
      deps += [ ":linux_tv_casting_app" ]
    }
    if (enable_linux_bridge_app_build) {
      deps += [ ":linux_bridge_app" ]
    }
    if (enable_linux_lighting_app_build) {
      deps += [ ":linux_lighting_app" ]
    }
    if (enable_efr32_lock_app_build) {
      deps += [ ":efr32_lock_app" ]
    }
    if (enable_efr32_lighting_app_build) {
      deps += [ ":efr32_lighting_app" ]
    }
    if (enable_efr32_window_app_build) {
      deps += [ ":efr32_window_app" ]
    }
    if (enable_p6_lock_app_build) {
      deps += [ ":p6_lock_app" ]
    }
    if (enable_k32w_lighting_app_build) {
      deps += [ ":k32w_lighting_app" ]
    }
    if (enable_k32w_lock_app_build) {
      deps += [ ":k32w_lock_app" ]
    }
    if (enable_k32w_shell_app_build) {
      deps += [ ":k32w_shell_app" ]
    }
    if (enable_qpg_lock_app_build) {
      deps += [ ":qpg_lock_app" ]
    }
    if (enable_cc13x2x7_26x2x7_lock_app_build) {
      deps += [ ":cc13x2x7_26x2x7_lock_app" ]
    }
  }

  group("check") {
    deps = []
    if (enable_host_clang_build) {
      deps += [ ":check_host_clang" ]
    }
    if (enable_host_gcc_build) {
      deps += [ ":check_host_gcc" ]
    }
    if (enable_host_gcc_mbedtls_build) {
      deps += [ ":check_host_gcc_mbedtls" ]
    }
    if (enable_fake_tests) {
      deps += [ ":check_fake_platform" ]
    }
  }
}
