# 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/app/chip_data_model.gni")
import("${chip_root}/src/lib/lib.gni")

config("config") {
  include_dirs = [
    ".",
    "${chip_root}/examples/chip-tool",
    "${chip_root}/zzz_generated/chip-tool",
    "${chip_root}/zzz_generated/tv-casting-app",
    "${chip_root}/src/lib",
  ]

  cflags = [ "-Wconversion" ]
}

chip_data_model("tv-casting-common") {
  zap_file = "tv-casting-app.zap"

  zap_pregenerated_dir =
      "${chip_root}/zzz_generated/tv-casting-app/zap-generated"

  sources = [
    "${chip_root}/examples/chip-tool/commands/clusters/ModelCommand.h",
    "${chip_root}/examples/chip-tool/commands/common/CHIPCommand.h",
    "${chip_root}/examples/chip-tool/commands/common/Command.cpp",
    "${chip_root}/examples/chip-tool/commands/common/Command.h",
    "${chip_root}/examples/chip-tool/commands/common/Commands.cpp",
    "${chip_root}/examples/chip-tool/commands/common/Commands.h",
    "${chip_root}/examples/chip-tool/commands/common/CredentialIssuerCommands.h",
    "${chip_root}/examples/chip-tool/commands/common/HexConversion.h",
    "${chip_root}/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp",
    "${chip_root}/examples/chip-tool/commands/common/RemoteDataModelLogger.h",
    "${chip_root}/src/controller/ExamplePersistentStorage.cpp",
    "${chip_root}/src/controller/ExamplePersistentStorage.h",
    "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp",
    "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp",
    "commands/clusters/ModelCommand.cpp",
    "commands/common/CHIPCommand.cpp",
    "include/AppParams.h",
    "include/ApplicationBasic.h",
    "include/ApplicationLauncher.h",
    "include/CastingServer.h",
    "include/Channel.h",
    "include/ContentLauncher.h",
    "include/KeypadInput.h",
    "include/LevelControl.h",
    "include/MediaBase.h",
    "include/MediaCommandBase.h",
    "include/MediaPlayback.h",
    "include/MediaReadBase.h",
    "include/MediaSubscriptionBase.h",
    "include/OnOff.h",
    "include/PersistenceManager.h",
    "include/TargetEndpointInfo.h",
    "include/TargetNavigator.h",
    "include/TargetVideoPlayerInfo.h",
    "src/AppParams.cpp",
    "src/ApplicationLauncher.cpp",
    "src/CastingServer.cpp",
    "src/Channel.cpp",
    "src/ContentLauncher.cpp",
    "src/KeypadInput.cpp",
    "src/LevelControl.cpp",
    "src/MediaPlayback.cpp",
    "src/OnOff.cpp",
    "src/PersistenceManager.cpp",
    "src/TargetEndpointInfo.cpp",
    "src/TargetNavigator.cpp",
    "src/TargetVideoPlayerInfo.cpp",
  ]

  # Add simplified casting API files here
  sources += [
    "core/CastingApp.cpp",
    "core/CastingApp.h",
    "core/Types.h",
    "support/AppParameters.h",
    "support/DataProvider.h",
  ]

  deps = [
    "${chip_root}/examples/common/tracing:commandline",
    "${chip_root}/src/app/tests/suites/commands/interaction_model",
    "${chip_root}/src/lib/support/jsontlv",
    "${chip_root}/src/tracing",
    "${chip_root}/src/tracing/json",
    "${chip_root}/third_party/inipp",
    "${chip_root}/third_party/jsoncpp",
  ]

  if (chip_enable_transport_trace) {
    public_deps =
        [ "${chip_root}/examples/common/tracing:trace_handlers_decoder" ]
  }

  public_configs = [ ":config" ]

  include_dirs =
      [ "${chip_root}/examples/tv-casting-app/tv-casting-common/include" ]

  is_server = true
}

static_library("tvCastingCommon") {
  public_deps = [
    "${chip_root}/examples/tv-casting-app/tv-casting-common",
    "${chip_root}/src/credentials:default_attestation_verifier",
  ]

  cflags = [ "-Wconversion" ]

  output_name = "libTvCastingCommon"

  output_dir = "${root_out_dir}/lib"

  complete_static_lib = true
}
