Skip to content

Commit b389c60

Browse files
authored
Add "orphaned" header files from src/lib/core into gn (project-chip#31810)
* Unorphan several files from core ... lets see how things compile * Pull out some separate headers into a new group as core references support * Add a lot of types dependencies * Add some missing headers because of bad include paths * One more sytem clock reference * Remove nonsense file commend from Unchecked ... copy and paste of these keeps getting us * Remove one more copy & pasted comment in a header * Add utility header to Optional * Fix boufallolab include
1 parent 9526318 commit b389c60

File tree

17 files changed

+51
-17
lines changed

17 files changed

+51
-17
lines changed

examples/chip-tool/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ static_library("chip-tool-utils") {
110110
"${chip_root}/src/controller/data_model",
111111
"${chip_root}/src/credentials:file_attestation_trust_store",
112112
"${chip_root}/src/lib",
113+
"${chip_root}/src/lib/core:types",
113114
"${chip_root}/src/lib/support/jsontlv",
114115
"${chip_root}/src/platform",
115116
"${chip_root}/third_party/inipp",

examples/common/tracing/BUILD.gn

+5-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ source_set("trace_handlers_decoder") {
9393

9494
public_configs = [ ":default_config" ]
9595

96-
deps = [ "${chip_root}/src/lib" ]
96+
deps = [
97+
"${chip_root}/src/lib",
98+
"${chip_root}/src/lib/core:types",
99+
]
97100
public_deps = [ "${chip_root}/third_party/jsoncpp" ]
98101

99102
cflags = [ "-Wconversion" ]
@@ -121,6 +124,7 @@ executable("chip-trace-decoder") {
121124

122125
public_deps = [
123126
"${chip_root}/src/lib",
127+
"${chip_root}/src/lib/core:types",
124128
"${chip_root}/third_party/jsoncpp",
125129
]
126130

examples/common/websocket-server/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ static_library("websocket-server") {
3434
]
3535

3636
public_deps = [
37+
"${chip_root}/src/lib/core:types",
3738
"${chip_root}/src/lib/support",
3839
"${chip_root}/third_party/libwebsockets",
3940
]

src/access/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ static_library("access") {
3434

3535
public_deps = [
3636
"${chip_root}/src/lib/core",
37+
"${chip_root}/src/lib/core:types",
3738
"${chip_root}/src/lib/support",
3839
"${chip_root}/src/platform",
3940
]

src/app/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ source_set("paths") {
9090
public_deps = [
9191
":app_config",
9292
"${chip_root}/src/lib/core",
93+
"${chip_root}/src/lib/core:types",
9394
]
9495
}
9596

src/app/DeferredAttributePersistenceProvider.h

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <app/AttributePersistenceProvider.h>
1919
#include <lib/support/ScopedBuffer.h>
2020
#include <lib/support/Span.h>
21+
#include <system/SystemClock.h>
2122

2223
namespace chip {
2324
namespace app {

src/credentials/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ static_library("credentials") {
125125
"${chip_root}/src/crypto",
126126
"${chip_root}/src/lib/asn1",
127127
"${chip_root}/src/lib/core",
128+
"${chip_root}/src/lib/core:types",
128129
"${chip_root}/src/lib/support",
129130
"${chip_root}/src/platform",
130131
"${chip_root}/src/protocols:type_definitions",

src/credentials/CHIPCert.h

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <lib/support/BitFlags.h>
4141
#include <lib/support/DLLUtil.h>
4242
#include <lib/support/Span.h>
43+
#include <system/SystemClock.h>
4344

4445
namespace chip {
4546
namespace Credentials {

src/crypto/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ source_set("public_headers") {
6868
":crypto_buildconfig",
6969
"${chip_root}/src/lib/asn1",
7070
"${chip_root}/src/lib/core",
71+
"${chip_root}/src/lib/core:types",
7172
"${chip_root}/src/lib/support",
7273
"${nlassert_root}:nlassert",
7374
]

src/inet/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ static_library("inet") {
100100

101101
public_deps = [
102102
":inet_config_header",
103+
"${chip_root}/src/lib/core:types",
103104
"${chip_root}/src/lib/support",
104105
"${chip_root}/src/platform:platform_config_header",
105106
"${chip_root}/src/system",

src/lib/core/BUILD.gn

+28
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,23 @@ source_set("error") {
104104
]
105105
}
106106

107+
source_set("types") {
108+
sources = [
109+
"CHIPSafeCasts.h",
110+
"Global.h",
111+
"InPlace.h",
112+
"Optional.h",
113+
"ReferenceCounted.h",
114+
"Unchecked.h",
115+
]
116+
117+
public_deps = [
118+
":chip_config_header",
119+
"${chip_root}/src/lib/support:memory",
120+
"${chip_root}/src/lib/support:verifymacros",
121+
]
122+
}
123+
107124
static_library("core") {
108125
output_name = "libChipCore"
109126

@@ -112,11 +129,13 @@ static_library("core") {
112129
# We should consider putting them directly in this directory
113130
# instead.
114131
"${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h",
132+
"CASEAuthTag.h",
115133
"CHIPCallback.h",
116134
"CHIPCore.h",
117135
"CHIPEncoding.h",
118136
"CHIPKeyIds.cpp",
119137
"CHIPKeyIds.h",
138+
"CHIPPersistentStorageDelegate.h",
120139
"ClusterEnums.h",
121140
"DataModelTypes.h",
122141
"GroupId.h",
@@ -125,17 +144,26 @@ static_library("core") {
125144
"OTAImageHeader.h",
126145
"PasscodeId.h",
127146
"PeerId.h",
147+
"ScopedNodeId.h",
128148
"TLV.h",
149+
"TLVBackingStore.h",
129150
"TLVCircularBuffer.cpp",
130151
"TLVCircularBuffer.h",
152+
"TLVCommon.h",
153+
"TLVData.h",
131154
"TLVDebug.cpp",
155+
"TLVDebug.h",
132156
"TLVReader.cpp",
157+
"TLVReader.h",
133158
"TLVTags.cpp",
134159
"TLVTags.h",
135160
"TLVTypes.h",
136161
"TLVUpdater.cpp",
162+
"TLVUpdater.h",
137163
"TLVUtilities.cpp",
164+
"TLVUtilities.h",
138165
"TLVWriter.cpp",
166+
"TLVWriter.h",
139167
]
140168

141169
cflags = [ "-Wconversion" ]

src/lib/core/InPlace.h

-7
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
18-
/**
19-
* @file
20-
* This file defines the chip::Optional class to handle values which may
21-
* or may not be present.
22-
*
23-
*/
2417
#pragma once
2518

2619
namespace chip {

src/lib/core/Optional.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525

2626
#include <new>
2727
#include <type_traits>
28+
#include <utility>
2829

29-
#include <lib/core/CHIPCore.h>
3030
#include <lib/core/InPlace.h>
31+
#include <lib/support/CodeUtils.h>
3132

3233
namespace chip {
3334

src/lib/core/Unchecked.h

-7
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
18-
/**
19-
* @file
20-
* This file defines the chip::Optional class to handle values which may
21-
* or may not be present.
22-
*
23-
*/
2417
#pragma once
2518

2619
namespace chip {

src/lib/support/BUILD.gn

+5-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ source_set("verifymacros") {
149149
source_set("span") {
150150
sources = [ "Span.h" ]
151151

152-
public_deps = [ ":verifymacros" ]
152+
public_deps = [
153+
":verifymacros",
154+
"${chip_root}/src/lib/core:types",
155+
]
153156
}
154157

155158
source_set("chip_version_header") {
@@ -254,6 +257,7 @@ static_library("support") {
254257
":verifymacros_no_logging",
255258
"${chip_root}/src/lib/core:chip_config_header",
256259
"${chip_root}/src/lib/core:error",
260+
"${chip_root}/src/lib/core:types",
257261
"${chip_root}/src/platform:platform_config_header",
258262
"${chip_root}/src/system:system_config_header",
259263
"${nlassert_root}:nlassert",

src/platform/bouffalolab/common/CHIPDevicePlatformEvent.h

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#pragma once
1919

2020
#include <platform/CHIPDeviceEvent.h>
21+
#include <system/SystemPacketBuffer.h>
2122

2223
#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
2324
#include <bluetooth/bluetooth.h>

src/protocols/bdx/BdxTransferSession.h

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <lib/core/CHIPError.h>
1111
#include <protocols/bdx/BdxMessages.h>
12+
#include <system/SystemClock.h>
1213
#include <system/SystemPacketBuffer.h>
1314
#include <transport/raw/MessageHeader.h>
1415

0 commit comments

Comments
 (0)