forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.gn
138 lines (123 loc) · 4.42 KB
/
BUILD.gn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# 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" ]
}