From 28c78af5643dbca32ee99a7f464e489db26430a3 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 26 Feb 2024 20:01:14 -0500 Subject: [PATCH] Define dependencies for some files in zzz_generated and compatenums.h (#32327) * Add dependency on CompatEnumNames as this is a requirement and direct include of cluster-enums.h * define ids as a source set for zzz generated * Fix dependencies * CompatEnumNames is NOT in a subdirectory of app, which is wrong however for now roll with it * Move CompatEnumNames to common so linter catches it * Restyle --- .github/workflows/lint.yml | 1 - src/app/common/BUILD.gn | 15 +++++++++++++++ src/app/{ => common}/CompatEnumNames.h | 0 .../templates/app/cluster-enums.zapt | 2 +- .../app-common/zap-generated/cluster-enums.h | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) rename src/app/{ => common}/CompatEnumNames.h (100%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e0255646dbc487..e5afb69fabd2b1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -96,7 +96,6 @@ jobs: --known-failure app/CommandHandler.h \ --known-failure app/CommandHandlerInterface.h \ --known-failure app/CommandSenderLegacyCallback.h \ - --known-failure app/CompatEnumNames.h \ --known-failure app/data-model/ListLargeSystemExtensions.h \ --known-failure app/EventHeader.h \ --known-failure app/EventLoggingTypes.h \ diff --git a/src/app/common/BUILD.gn b/src/app/common/BUILD.gn index 1af268a477efaf..de7eef3008588d 100644 --- a/src/app/common/BUILD.gn +++ b/src/app/common/BUILD.gn @@ -18,6 +18,19 @@ config("includes") { include_dirs = [ "${chip_root}/zzz_generated/app-common" ] } +source_set("ids") { + sources = [ + "${chip_root}/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h", + "${chip_root}/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h", + "${chip_root}/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h", + "${chip_root}/zzz_generated/app-common/app-common/zap-generated/ids/Events.h", + ] + + public_deps = [ "${chip_root}/src/app/util:types" ] + + public_configs = [ ":includes" ] +} + static_library("cluster-objects") { output_name = "libClusterObjects" @@ -27,6 +40,7 @@ static_library("cluster-objects") { ] public_deps = [ + ":ids", "${chip_root}/src/app:paths", "${chip_root}/src/app/data-model", "${chip_root}/src/app/util:types", @@ -42,6 +56,7 @@ source_set("enums") { sources = [ "${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h", "${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h", + "CompatEnumNames.h", ] public_configs = [ ":includes" ] diff --git a/src/app/CompatEnumNames.h b/src/app/common/CompatEnumNames.h similarity index 100% rename from src/app/CompatEnumNames.h rename to src/app/common/CompatEnumNames.h diff --git a/src/app/zap-templates/templates/app/cluster-enums.zapt b/src/app/zap-templates/templates/app/cluster-enums.zapt index 612b3dd6a29d4b..17ce795200795f 100644 --- a/src/app/zap-templates/templates/app/cluster-enums.zapt +++ b/src/app/zap-templates/templates/app/cluster-enums.zapt @@ -70,4 +70,4 @@ k{{asUpperCamelCase label}} = {{asHex mask}}, } // namespace chip // Included at the end, so all our definitions above are available. -#include +#include diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 1a1afc11a522d1..42a54b95ee944f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -4893,4 +4893,4 @@ namespace SampleMei {} // namespace SampleMei } // namespace chip // Included at the end, so all our definitions above are available. -#include +#include