blob: b4e81158d497e8386b0ea257ac0ff276ac8881f2 [file] [log] [blame]
# 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/common_flags.gni")
import("${chip_root}/src/lib/lib.gni")
import("${chip_root}/src/platform/device.gni")
import("${chip_root}/src/platform/python.gni")
source_set("nodatamodel") {
sources = [ "EmptyDataModelHandler.cpp" ]
public_deps = [ "${chip_root}/src/app" ]
}
CHIP_CONTROLLER_HEADERS = [ "ExampleOperationalCredentialsIssuer.h" ]
CHIP_READ_CLIENT_HEADERS = [
"CommissioningWindowOpener.h",
"CurrentFabricRemover.h",
]
# This source set exists specifically to deny including them without dependencies
# if "controller" sources do not contain them
#
# They are NOT intended to be used directly.
#
# The intent for this is to force gn to be aware that these files are known and
# error out as `include not allowed due to missing dependency` even if
# controller is built without these sources
source_set("gen_check_chip_controller_headers") {
sources = CHIP_CONTROLLER_HEADERS
}
source_set("gen_check_chip_read_client_headers") {
sources = CHIP_READ_CLIENT_HEADERS
}
source_set("delegates") {
sources = [ "OperationalCredentialsDelegate.h" ]
}
static_library("controller") {
output_name = "libChipController"
sources = [
# TODO: these dependencies are broken. Specifically:
# a) ChipDeviceControllerFactory.h includes CHIPDeviceController.h
# b) CHIPDeviceController.cpp is only compiled for read_client
# These conditionals are NOT ok and should have been solved with separate
# source sets - either include some functionality or do not
#
# Then CHIPDeviceController.h pulls in AbstractDnssdDiscoveryController and everything
# cascades. In the end it looks like basically every header file is pulled in.
#
# Unfortunately this is hard to fix in one go, hence these odd list of header-only
# dependencies
"AbstractDnssdDiscoveryController.h",
"AutoCommissioner.h",
"CHIPCluster.h",
"CHIPCommissionableNodeController.h",
"CHIPDeviceController.h",
"CHIPDeviceControllerSystemState.h",
"CommandSenderAllocator.h",
"CommissioneeDeviceProxy.h",
"CommissioningDelegate.h",
"CommissioningWindowParams.h",
"DeviceDiscoveryDelegate.h",
"DevicePairingDelegate.h",
"InvokeInteraction.h",
"ReadInteraction.h",
"SetUpCodePairer.h",
"TypedCommandCallback.h",
"TypedReadCallback.h",
"WriteInteraction.h",
]
if (chip_controller && chip_build_controller) {
sources += CHIP_CONTROLLER_HEADERS
sources += [
"AbstractDnssdDiscoveryController.cpp",
"AutoCommissioner.cpp",
"CHIPCommissionableNodeController.cpp",
"CHIPDeviceControllerFactory.cpp",
"CHIPDeviceControllerFactory.h",
"CommissioneeDeviceProxy.cpp",
"CommissionerDiscoveryController.cpp",
"CommissionerDiscoveryController.h",
"CommissioningDelegate.cpp",
"ExampleOperationalCredentialsIssuer.cpp",
"SetUpCodePairer.cpp",
]
if (chip_enable_read_client) {
sources += CHIP_READ_CLIENT_HEADERS
sources += [
"CHIPDeviceController.cpp",
"CommissioningWindowOpener.cpp",
"CurrentFabricRemover.cpp",
]
}
}
cflags = [ "-Wconversion" ]
public_deps = [
"${chip_root}/src/app",
"${chip_root}/src/app/server",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/dnssd",
"${chip_root}/src/lib/support",
"${chip_root}/src/messaging",
"${chip_root}/src/platform",
"${chip_root}/src/protocols",
"${chip_root}/src/setup_payload",
"${chip_root}/src/tracing",
"${chip_root}/src/tracing:macros",
"${chip_root}/src/transport",
]
deps = [ "${chip_root}/src/lib/address_resolve" ]
if (chip_controller && chip_build_controller) {
# ExampleOperationalCredentialsIssuer uses TestGroupData
deps += [ "${chip_root}/src/lib/support:testing" ]
}
public_configs = [ "${chip_root}/src:includes" ]
}