Skip to content

Commit

Permalink
Add "orphaned" header files from src/lib/core into gn (project-chip#3…
Browse files Browse the repository at this point in the history
…1810)

* 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
  • Loading branch information
andy31415 authored Feb 1, 2024
1 parent 9526318 commit b389c60
Show file tree
Hide file tree
Showing 17 changed files with 51 additions and 17 deletions.
1 change: 1 addition & 0 deletions examples/chip-tool/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ static_library("chip-tool-utils") {
"${chip_root}/src/controller/data_model",
"${chip_root}/src/credentials:file_attestation_trust_store",
"${chip_root}/src/lib",
"${chip_root}/src/lib/core:types",
"${chip_root}/src/lib/support/jsontlv",
"${chip_root}/src/platform",
"${chip_root}/third_party/inipp",
Expand Down
6 changes: 5 additions & 1 deletion examples/common/tracing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ source_set("trace_handlers_decoder") {

public_configs = [ ":default_config" ]

deps = [ "${chip_root}/src/lib" ]
deps = [
"${chip_root}/src/lib",
"${chip_root}/src/lib/core:types",
]
public_deps = [ "${chip_root}/third_party/jsoncpp" ]

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

public_deps = [
"${chip_root}/src/lib",
"${chip_root}/src/lib/core:types",
"${chip_root}/third_party/jsoncpp",
]

Expand Down
1 change: 1 addition & 0 deletions examples/common/websocket-server/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ static_library("websocket-server") {
]

public_deps = [
"${chip_root}/src/lib/core:types",
"${chip_root}/src/lib/support",
"${chip_root}/third_party/libwebsockets",
]
Expand Down
1 change: 1 addition & 0 deletions src/access/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ static_library("access") {

public_deps = [
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/core:types",
"${chip_root}/src/lib/support",
"${chip_root}/src/platform",
]
Expand Down
1 change: 1 addition & 0 deletions src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ source_set("paths") {
public_deps = [
":app_config",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/core:types",
]
}

Expand Down
1 change: 1 addition & 0 deletions src/app/DeferredAttributePersistenceProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <app/AttributePersistenceProvider.h>
#include <lib/support/ScopedBuffer.h>
#include <lib/support/Span.h>
#include <system/SystemClock.h>

namespace chip {
namespace app {
Expand Down
1 change: 1 addition & 0 deletions src/credentials/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ static_library("credentials") {
"${chip_root}/src/crypto",
"${chip_root}/src/lib/asn1",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/core:types",
"${chip_root}/src/lib/support",
"${chip_root}/src/platform",
"${chip_root}/src/protocols:type_definitions",
Expand Down
1 change: 1 addition & 0 deletions src/credentials/CHIPCert.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <lib/support/BitFlags.h>
#include <lib/support/DLLUtil.h>
#include <lib/support/Span.h>
#include <system/SystemClock.h>

namespace chip {
namespace Credentials {
Expand Down
1 change: 1 addition & 0 deletions src/crypto/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ source_set("public_headers") {
":crypto_buildconfig",
"${chip_root}/src/lib/asn1",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/core:types",
"${chip_root}/src/lib/support",
"${nlassert_root}:nlassert",
]
Expand Down
1 change: 1 addition & 0 deletions src/inet/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ static_library("inet") {

public_deps = [
":inet_config_header",
"${chip_root}/src/lib/core:types",
"${chip_root}/src/lib/support",
"${chip_root}/src/platform:platform_config_header",
"${chip_root}/src/system",
Expand Down
28 changes: 28 additions & 0 deletions src/lib/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,23 @@ source_set("error") {
]
}

source_set("types") {
sources = [
"CHIPSafeCasts.h",
"Global.h",
"InPlace.h",
"Optional.h",
"ReferenceCounted.h",
"Unchecked.h",
]

public_deps = [
":chip_config_header",
"${chip_root}/src/lib/support:memory",
"${chip_root}/src/lib/support:verifymacros",
]
}

static_library("core") {
output_name = "libChipCore"

Expand All @@ -112,11 +129,13 @@ static_library("core") {
# We should consider putting them directly in this directory
# instead.
"${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h",
"CASEAuthTag.h",
"CHIPCallback.h",
"CHIPCore.h",
"CHIPEncoding.h",
"CHIPKeyIds.cpp",
"CHIPKeyIds.h",
"CHIPPersistentStorageDelegate.h",
"ClusterEnums.h",
"DataModelTypes.h",
"GroupId.h",
Expand All @@ -125,17 +144,26 @@ static_library("core") {
"OTAImageHeader.h",
"PasscodeId.h",
"PeerId.h",
"ScopedNodeId.h",
"TLV.h",
"TLVBackingStore.h",
"TLVCircularBuffer.cpp",
"TLVCircularBuffer.h",
"TLVCommon.h",
"TLVData.h",
"TLVDebug.cpp",
"TLVDebug.h",
"TLVReader.cpp",
"TLVReader.h",
"TLVTags.cpp",
"TLVTags.h",
"TLVTypes.h",
"TLVUpdater.cpp",
"TLVUpdater.h",
"TLVUtilities.cpp",
"TLVUtilities.h",
"TLVWriter.cpp",
"TLVWriter.h",
]

cflags = [ "-Wconversion" ]
Expand Down
7 changes: 0 additions & 7 deletions src/lib/core/InPlace.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file
* This file defines the chip::Optional class to handle values which may
* or may not be present.
*
*/
#pragma once

namespace chip {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/core/Optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@

#include <new>
#include <type_traits>
#include <utility>

#include <lib/core/CHIPCore.h>
#include <lib/core/InPlace.h>
#include <lib/support/CodeUtils.h>

namespace chip {

Expand Down
7 changes: 0 additions & 7 deletions src/lib/core/Unchecked.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file
* This file defines the chip::Optional class to handle values which may
* or may not be present.
*
*/
#pragma once

namespace chip {
Expand Down
6 changes: 5 additions & 1 deletion src/lib/support/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ source_set("verifymacros") {
source_set("span") {
sources = [ "Span.h" ]

public_deps = [ ":verifymacros" ]
public_deps = [
":verifymacros",
"${chip_root}/src/lib/core:types",
]
}

source_set("chip_version_header") {
Expand Down Expand Up @@ -254,6 +257,7 @@ static_library("support") {
":verifymacros_no_logging",
"${chip_root}/src/lib/core:chip_config_header",
"${chip_root}/src/lib/core:error",
"${chip_root}/src/lib/core:types",
"${chip_root}/src/platform:platform_config_header",
"${chip_root}/src/system:system_config_header",
"${nlassert_root}:nlassert",
Expand Down
1 change: 1 addition & 0 deletions src/platform/bouffalolab/common/CHIPDevicePlatformEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#pragma once

#include <platform/CHIPDeviceEvent.h>
#include <system/SystemPacketBuffer.h>

#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
#include <bluetooth/bluetooth.h>
Expand Down
1 change: 1 addition & 0 deletions src/protocols/bdx/BdxTransferSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <lib/core/CHIPError.h>
#include <protocols/bdx/BdxMessages.h>
#include <system/SystemClock.h>
#include <system/SystemPacketBuffer.h>
#include <transport/raw/MessageHeader.h>

Expand Down

0 comments on commit b389c60

Please sign in to comment.