# Copyright 2022 The Pigweed 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
#
#     https://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/pigweed.gni")

import("$dir_pw_arduino_build/arduino.gni")
import("$dir_pw_build/target_types.gni")
import("$dir_pw_unit_test/test.gni")

group("all") {
  deps = [ ":terminal_demo" ]
}

pw_source_set("text_buffer") {
  public_deps = [
    "$dir_pw_result",
    "$dir_pwexperimental_color",
    "$dir_pwexperimental_math",
  ]
  sources = [
    "text_buffer.cc",
    "text_buffer.h",
  ]
}

pw_executable("terminal_demo") {
  sources = [ "main.cc" ]
  deps = [
    ":text_buffer",
    "$dir_app_common",
    "$dir_pw_board_led",
    "$dir_pw_containers:vector",
    "$dir_pw_log",
    "$dir_pw_random",
    "$dir_pw_ring_buffer",
    "$dir_pw_spin_delay",
    "$dir_pw_string",
    "$dir_pw_sys_io",
    "$dir_pwexperimental_color",
    "$dir_pwexperimental_display",
    "$dir_pwexperimental_draw",
    "$dir_pwexperimental_framebuffer",
    "$dir_pwexperimental_math",
  ]
  remove_configs = [ "$dir_pw_build:strict_warnings" ]

  if (host_os == "linux") {
    remove_configs += [ "$dir_pw_toolchain/host_clang:linux_sysroot" ]
  }

  # Hack for targets with no pre-init target implementation.
  defines = []
  if (pw_build_EXECUTABLE_TARGET_TYPE != "executable" &&
      pw_build_EXECUTABLE_TARGET_TYPE != "arduino_executable") {
    defines += [ "USE_FREERTOS" ]
    deps += [ "$dir_pw_third_party/freertos" ]
  }
  if (pw_build_EXECUTABLE_TARGET_TYPE == "pico_executable") {
    defines += [ "DEFINE_FREERTOS_MEMORY_FUNCTIONS=1" ]
  }

  if (pw_build_EXECUTABLE_TARGET_TYPE == "arduino_executable" ||
      pw_build_EXECUTABLE_TARGET_TYPE == "pico_executable" ||
      pw_build_EXECUTABLE_TARGET_TYPE == "mimxrt595_executable") {
    ldflags = [ "-Wl,--print-memory-usage" ]
  }
}

pw_test("text_buffer_test") {
  deps = [
    ":text_buffer",
    "$dir_pw_unit_test",
    "$dir_pwexperimental_color",
  ]
  sources = [ "text_buffer_test.cc" ]
}

pw_test_group("tests") {
  tests = [ ":text_buffer_test" ]
}
