# 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/chip.gni")

import("${chip_root}/src/lib/core/core.gni")
import("${chip_root}/src/lib/shell/shell_device.gni")
import("${chip_root}/src/platform/device.gni")

source_set("shell_core") {
  sources = [
    "Commands.h",
    "Engine.cpp",
    "Engine.h",
    "streamer.cpp",
    "streamer.h",
  ]

  public_deps = [
    "${chip_root}/src/lib/core",
    "${chip_root}/src/lib/support",
    "${chip_root}/src/platform",
  ]
}

static_library("shell") {
  output_name = "libCHIPShell"
  output_dir = "${root_out_dir}/lib"

  sources = []

  if (chip_target_style == "unix") {
    sources += [ "streamer_stdio.cpp" ]
  }

  if (chip_device_platform == "esp32" ||
      (chip_device_platform == "external" && chip_shell_platform == "esp32")) {
    sources += [
      "MainLoopESP32.cpp",
      "streamer_esp32.cpp",
    ]
  } else if (chip_device_platform == "efr32" ||
             chip_device_platform == "SiWx917") {
    sources += [
      "MainLoopSilabs.cpp",
      "streamer_silabs.cpp",
    ]
  } else if (chip_device_platform == "k32w0") {
    sources += [
      "MainLoopDefault.cpp",
      "streamer_k32w.cpp",
    ]
  } else if (chip_device_platform == "nxp") {
    sources += [
      "MainLoopDefault.cpp",
      "streamer_nxp.cpp",
    ]
  } else if (chip_device_platform == "cyw30739") {
    sources += [
      "MainLoopCYW30739.cpp",
      "streamer_cyw30739.cpp",
    ]
  } else if (chip_device_platform == "mt793x") {
    sources += [
      "MainLoopDefault.cpp",
      "streamer_mt793x.cpp",
    ]
  } else if (current_os == "zephyr") {
    sources += [
      "MainLoopZephyr.cpp",
      "streamer_zephyr.cpp",
      "streamer_zephyr.h",
    ]
  } else if (chip_device_platform == "qpg") {
    sources += [
      "MainLoopDefault.cpp",
      "streamer_qpg.cpp",
    ]
  } else if (chip_device_platform == "bl602" ||
             chip_device_platform == "bl702" ||
             chip_device_platform == "bl702l") {
    sources += [
      "MainLoopDefault.cpp",
      "streamer_bouffalolab.cpp",
    ]
  } else if (chip_device_platform == "cc13x2_26x2" ||
             chip_device_platform == "cc13x4_26x4") {
    sources += [
      "MainLoopDefault.cpp",
      "streamer_cc13x4_26x4.cpp",
    ]
  } else if (chip_device_platform == "mw320") {
    sources += [
      "MainLoopMW320.cpp",
      "streamer_mw320.cpp",
    ]
  } else if (chip_device_platform == "ameba") {
    sources += [
      "MainLoopAmeba.cpp",
      "streamer_ameba.cpp",
    ]
  } else if (chip_device_platform == "openiotsdk") {
    sources += [
      "MainLoopDefault.cpp",
      "streamer_openiotsdk.cpp",
    ]
  } else if (chip_device_platform == "asr") {
    sources += [
      "MainLoopDefault.cpp",
      "streamer_asr.cpp",
    ]
  } else {
    sources += [ "MainLoopDefault.cpp" ]
  }

  if (current_os == "mbed") {
    sources += [ "streamer_mbed.cpp" ]
  }

  cflags = [ "-Wconversion" ]

  public_deps = [
    ":shell_core",
    "${chip_root}/src/lib/shell/commands",
  ]
}
