# Copyright (c) 2024 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/build.gni")
import("//build_overrides/chip.gni")
import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/src/lib/lib.gni")

assert(chip_build_tools)

executable("fabric-sync") {
  cflags = [ "-Wconversion" ]

  defines = []

  if (chip_build_libshell) {
    defines += [ "ENABLE_CHIP_SHELL" ]
  }

  include_dirs = [
    ".",
    "${chip_root}/src/lib",
  ]

  if (chip_build_libshell) {
    include_dirs += [ "shell" ]
  }

  sources = [ "main.cpp" ]

  deps = [
    "${chip_root}/examples/fabric-sync/admin:fabric-admin-lib",
    "${chip_root}/examples/fabric-sync/bridge:fabric-bridge-lib",
    "${chip_root}/examples/platform/linux:app-main",
    "${chip_root}/src/lib",
    "${chip_root}/third_party/inipp",
  ]

  if (chip_build_libshell) {
    deps += [ "${chip_root}/examples/fabric-sync/shell" ]
  }

  output_dir = root_out_dir
}

group("default") {
  deps = [ ":fabric-sync" ]
}
