# Copyright (c) 2021 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}/config/recommended.gni")

declare_args() {
  # Temporary flag for interaction model and echo protocols, set it to true to enable
  chip_app_use_echo = false
  chip_enable_read_client = true
  chip_build_controller_dynamic_server = false

  # Flag that controls whether the time-to-wait from BUSY responses is
  # communicated to OperationalSessionSetup API consumers.
  chip_enable_busy_handling_for_operational_session_setup = true

  # Data model interface usage:
  #   - disabled: does not use data model interface at all
  #   - check:    runs BOTH datamodel and non-data-model (if possible) functionality and compares results
  #   - enabled:  runs only the data model interface (does not use the legacy code)
  if (matter_enable_recommended && current_os == "linux") {
    chip_use_data_model_interface = "check"
  } else {
    chip_use_data_model_interface = "enabled"
  }

  # Whether we call `chipDie` on DM `check` errors
  #
  # If/once the chip_use_data_model_interface flag is removed or does not support
  # a `check` option, this should alwo be removed
  chip_data_model_check_die_on_failure = false

  # This controls if more logging is supposed to be enabled into the data models.
  # This is an optimization for small-flash size devices as extra logging requires
  # additional flash for messages & code for formatting.
  chip_data_model_extra_logging =
      current_os == "linux" || current_os == "ios" || current_os == "mac" ||
      current_os == "android"
}
