# 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" ]

  defines = [ "CONFIG_USE_SEPARATE_EVENTLOOP=0" ]
}

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

  sources = [
    "${chip_root}/examples/chip-tool/commands/clusters/ModelCommand.h",
    "${chip_root}/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.cpp",
    "${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",
    "clusters/content-app-observer/ContentAppObserver.cpp",
    "clusters/content-app-observer/ContentAppObserver.h",
    "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/ConversionUtils.h",
    "include/KeypadInput.h",
    "include/LevelControl.h",
    "include/MediaBase.h",
    "include/MediaCommandBase.h",
    "include/MediaPlayback.h",
    "include/MediaReadBase.h",
    "include/MediaSubscriptionBase.h",
    "include/Messages.h",
    "include/OnOff.h",
    "include/PersistenceManager.h",
    "include/TargetEndpointInfo.h",
    "include/TargetNavigator.h",
    "include/TargetVideoPlayerInfo.h",
    "include/WakeOnLan.h",
    "src/AppParams.cpp",
    "src/ApplicationLauncher.cpp",
    "src/CastingServer.cpp",
    "src/Channel.cpp",
    "src/ContentLauncher.cpp",
    "src/ConversionUtils.cpp",
    "src/KeypadInput.cpp",
    "src/LevelControl.cpp",
    "src/MediaPlayback.cpp",
    "src/Messages.cpp",
    "src/OnOff.cpp",
    "src/PersistenceManager.cpp",
    "src/TargetEndpointInfo.cpp",
    "src/TargetNavigator.cpp",
    "src/TargetVideoPlayerInfo.cpp",
    "src/WakeOnLan.cpp",
    "src/ZCLCallbacks.cpp",
  ]

  # Add simplified casting API files here
  sources += [
    "clusters/Clusters.h",
    "core/Attribute.h",
    "core/BaseCluster.h",
    "core/CastingApp.cpp",
    "core/CastingApp.h",
    "core/CastingPlayer.cpp",
    "core/CastingPlayer.h",
    "core/CastingPlayerDiscovery.cpp",
    "core/CastingPlayerDiscovery.h",
    "core/Command.h",
    "core/CommissionerDeclarationHandler.cpp",
    "core/CommissionerDeclarationHandler.h",
    "core/ConnectionCallbacks.h",
    "core/Endpoint.cpp",
    "core/Endpoint.h",
    "core/Types.h",
    "support/AppParameters.h",
    "support/CastingStore.cpp",
    "support/CastingStore.h",
    "support/ChipDeviceEventHandler.cpp",
    "support/ChipDeviceEventHandler.h",
    "support/DataProvider.h",
    "support/EndpointListLoader.cpp",
    "support/EndpointListLoader.h",
  ]

  deps = [
    "${chip_root}/examples/common/tracing:commandline",
    "${chip_root}/src/app/icd/client:handler",
    "${chip_root}/src/app/icd/client:manager",
    "${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",
    "${chip_root}/examples/tv-casting-app/tv-casting-common",
  ]

  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
}
