# 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("//build_overrides/nlio.gni")

import("${chip_root}/build/chip/buildconfig_header.gni")
import("common_flags.gni")

declare_args() {
  # Enable strict schema checks.
  chip_enable_schema_check =
      is_debug && (current_os == "linux" || current_os == "mac")
}

buildconfig_header("app_buildconfig") {
  header = "AppBuildConfig.h"
  header_dir = "app"

  defines = [ "CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK=${chip_enable_schema_check}" ]
}

static_library("app") {
  output_name = "libCHIPDataModel"

  sources = [
    "AttributePathParams.cpp",
    "Command.cpp",
    "Command.h",
    "CommandHandler.cpp",
    "CommandSender.cpp",
    "EventManagement.cpp",
    "InteractionModelEngine.cpp",
    "MessageDef/ArrayBuilder.cpp",
    "MessageDef/ArrayParser.cpp",
    "MessageDef/AttributeDataElement.cpp",
    "MessageDef/AttributeDataElement.h",
    "MessageDef/AttributeDataList.cpp",
    "MessageDef/AttributeDataList.h",
    "MessageDef/AttributeDataVersionList.cpp",
    "MessageDef/AttributeDataVersionList.h",
    "MessageDef/AttributePathIB.cpp",
    "MessageDef/AttributePathIB.h",
    "MessageDef/AttributePaths.cpp",
    "MessageDef/AttributePaths.h",
    "MessageDef/AttributeStatusIB.cpp",
    "MessageDef/AttributeStatusIB.h",
    "MessageDef/AttributeStatuses.cpp",
    "MessageDef/AttributeStatuses.h",
    "MessageDef/Builder.cpp",
    "MessageDef/Builder.h",
    "MessageDef/CommandDataIB.cpp",
    "MessageDef/CommandPathIB.cpp",
    "MessageDef/CommandStatusIB.cpp",
    "MessageDef/EventDataIB.cpp",
    "MessageDef/EventDataIB.h",
    "MessageDef/EventFilterIB.cpp",
    "MessageDef/EventFilters.cpp",
    "MessageDef/EventPathIB.cpp",
    "MessageDef/EventPathIB.h",
    "MessageDef/EventPaths.cpp",
    "MessageDef/EventPaths.h",
    "MessageDef/EventReportIB.cpp",
    "MessageDef/EventReportIB.h",
    "MessageDef/EventReports.cpp",
    "MessageDef/EventReports.h",
    "MessageDef/EventStatusIB.cpp",
    "MessageDef/EventStatusIB.h",
    "MessageDef/InvokeRequestMessage.cpp",
    "MessageDef/InvokeRequests.cpp",
    "MessageDef/InvokeResponseIB.cpp",
    "MessageDef/InvokeResponseMessage.cpp",
    "MessageDef/InvokeResponses.cpp",
    "MessageDef/ListBuilder.cpp",
    "MessageDef/ListParser.cpp",
    "MessageDef/MessageDefHelper.cpp",
    "MessageDef/MessageDefHelper.h",
    "MessageDef/Parser.cpp",
    "MessageDef/Parser.h",
    "MessageDef/ReadRequestMessage.cpp",
    "MessageDef/ReadRequestMessage.h",
    "MessageDef/ReportDataMessage.cpp",
    "MessageDef/ReportDataMessage.h",
    "MessageDef/StatusIB.cpp",
    "MessageDef/StatusIB.h",
    "MessageDef/StatusResponseMessage.cpp",
    "MessageDef/StructBuilder.cpp",
    "MessageDef/StructParser.cpp",
    "MessageDef/SubscribeRequestMessage.cpp",
    "MessageDef/SubscribeResponseMessage.cpp",
    "MessageDef/TimedRequestMessage.cpp",
    "MessageDef/WriteRequestMessage.cpp",
    "MessageDef/WriteResponseMessage.cpp",
    "ReadClient.cpp",
    "ReadHandler.cpp",
    "WriteClient.cpp",
    "WriteHandler.cpp",
    "decoder.cpp",
    "encoder-common.cpp",
    "reporting/Engine.cpp",
    "reporting/Engine.h",
  ]

  if (chip_ip_commissioning) {
    defines = [
      "CONFIG_USE_CLUSTERS_FOR_IP_COMMISSIONING=1",
      "CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY=1",
    ]
  }

  public_deps = [
    ":app_buildconfig",
    "${chip_root}/src/lib/support",
    "${chip_root}/src/messaging",
    "${chip_root}/src/protocols/secure_channel",
    "${chip_root}/src/system",
    "${nlio_root}:nlio",
  ]

  cflags = [ "-Wconversion" ]

  public_configs = [ "${chip_root}/src:includes" ]
}
