Skip to content

Commit

Permalink
Add Span.h to a source_set that tracks its dependencies.
Browse files Browse the repository at this point in the history
This requires that those dependencies be separate things that are not the entire
"support" library, because some things need Span but can't depend on all of
"support".  Maybe these should just all be lumped into "support_core"... but
then why are these things in support/ and not core/ (which are very much "these
are the same thing, but we are going to pretend the are not).

Fixes #29490
  • Loading branch information
bzbarsky-apple committed Oct 9, 2023
1 parent 52225dd commit e9915b4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
39 changes: 37 additions & 2 deletions src/lib/support/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,40 @@ source_set("attributes") {
]
}

source_set("logging_header") {
sources = [ "logging/CHIPLogging.h" ]

public_deps = [
":attributes",
":logging_constants",
"${chip_root}/src/lib/core:chip_config_header",
]

if (chip_pw_tokenizer_logging) {
public_deps += [ "${dir_pw_tokenizer}" ]
}
}

source_set("codeutils") {
sources = [
"CodeUtils.h",
]

public_deps = [
":attributes",
":logging_header",
"${chip_root}/src/lib/core:chip_config_header",
"${chip_root}/src/lib/core:error",
"${nlassert_root}:nlassert",
]
}

source_set("span") {
sources = [ "Span.h" ]

public_deps = [ ":codeutils" ]
}

source_set("chip_version_header") {
sources = get_target_outputs(":gen_chip_version")

Expand Down Expand Up @@ -102,7 +136,6 @@ static_library("support") {
"CHIPMemString.h",
"CHIPPlatformMemory.cpp",
"CHIPPlatformMemory.h",
"CodeUtils.h",
"DLLUtil.h",
"DefaultStorageKeyAllocator.h",
"Defer.h",
Expand Down Expand Up @@ -141,7 +174,6 @@ static_library("support") {
"ZclString.cpp",
"ZclString.h",
"logging/CHIPLogging.cpp",
"logging/CHIPLogging.h",
"verhoeff/Verhoeff.cpp",
"verhoeff/Verhoeff.h",
"verhoeff/Verhoeff10.cpp",
Expand All @@ -168,7 +200,10 @@ static_library("support") {
public_deps = [
":attributes",
":chip_version_header",
":codeutils",
":logging_constants",
":logging_header",
":span",
"${chip_root}/src/lib/core:chip_config_header",
"${chip_root}/src/lib/core:error",
"${chip_root}/src/platform:platform_buildconfig",
Expand Down
3 changes: 1 addition & 2 deletions src/platform/Darwin/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,9 @@ static_library("logging") {
]

deps = [
"${chip_root}/src/lib/core:chip_config_header", # for lib/support/Span.h
"${chip_root}/src/lib/support:attributes",
"${chip_root}/src/lib/support:logging_constants",
"${nlassert_root}:nlassert", # for lib/support/Span.h
"${chip_root}/src/lib/support:span",
]

configs += [ "${chip_root}/src:includes" ]
Expand Down

0 comments on commit e9915b4

Please sign in to comment.