# 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 == "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",
  ]
}
