# 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/chip.gni")

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

import("//with_pw_rpc.gni")

assert(chip_build_tools)

declare_args() {
  bridge_enable_pw_rpc = false
}

if (bridge_enable_pw_rpc) {
  import("//build_overrides/pigweed.gni")
  import("$dir_pw_build/target_types.gni")
  import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
}

executable("fabric-bridge-app") {
  sources = [
    "${chip_root}/examples/fabric-bridge-app/fabric-bridge-common/include/CHIPProjectAppConfig.h",
    "CommissionerControlDelegate.cpp",
    "main.cpp",
  ]

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

  include_dirs = [ "include" ]

  if (bridge_enable_pw_rpc) {
    defines = [
      "PW_RPC_FABRIC_ADMIN_SERVICE=1",
      "PW_RPC_FABRIC_BRIDGE_SERVICE=1",
    ]

    sources += [
      "${chip_root}/examples/platform/linux/RpcClientProcessor.cpp",
      "${chip_root}/examples/platform/linux/RpcClientProcessor.h",
      "${chip_root}/examples/platform/linux/system_rpc_server.cc",
      "RpcClient.cpp",
      "RpcServer.cpp",
      "include/RpcClient.h",
      "include/RpcServer.h",
    ]

    deps += [
      "$dir_pw_hdlc:default_addresses",
      "$dir_pw_hdlc:rpc_channel_output",
      "$dir_pw_log",
      "$dir_pw_rpc:server",
      "$dir_pw_rpc/system_server:facade",
      "$dir_pw_rpc/system_server:socket",
      "$dir_pw_stream:socket_stream",
      "$dir_pw_sync:mutex",
      "${chip_root}/config/linux/lib/pw_rpc:pw_rpc",
      "${chip_root}/examples/common/pigweed:fabric_admin_service.nanopb_rpc",
      "${chip_root}/examples/common/pigweed:fabric_bridge_service.nanopb_rpc",
      "${chip_root}/examples/common/pigweed:rpc_services",
    ]

    deps += pw_build_LINK_DEPS

    include_dirs += [
      "${chip_root}/examples/common",
      "${chip_root}/examples/platform/linux",
    ]
  } else {
    # The system_rpc_server.cc file is in pigweed and doesn't compile with
    # -Wconversion, remove check for RPC build only.
    cflags = [ "-Wconversion" ]
  }

  output_dir = root_out_dir
}

group("linux") {
  deps = [ ":fabric-bridge-app" ]
}

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