Skip to content

Commit

Permalink
Fix path conflicts in chip_data_model in some projects
Browse files Browse the repository at this point in the history
The chip_data_model template builds a library that contains 2 files
named encoder.cpp and two files name attribute-size.cpp.

While this is not a problem with pigweed's toolchain definitions because
different directories are used, it can cause a path conflict if a
project defines a toolchain that places all of a library's .o files in
the same directory:

ERROR at //third_party/connectedhomeip/repo/src/app/chip_data_model.gni:59:3: Duplicate object file
  source_set(_data_model_name) {
  ^-----------------------------
The target //third_party/connectedhomeip/repo/src/controller/data_model:data_model
generates two object files with the same name:
  obj/third_party/connectedhomeip/repo/src/controller/data_model/data_model/attribute-size.o

Rename some files so that all files in the same library have distinct
filenames, which should be compatible with most reasonable toolchain
definitions.

Change-Id: I75f755cd4231563a57eca1e5286527c9ea88149e
  • Loading branch information
mspang committed Jun 15, 2021
1 parent 14718be commit 2255968
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static_library("app") {
"ReadClient.cpp",
"ReadHandler.cpp",
"decoder.cpp",
"encoder.cpp",
"encoder-common.cpp",
"reporting/Engine.cpp",
"reporting/Engine.h",
]
Expand Down
4 changes: 2 additions & 2 deletions src/app/chip_data_model.gni
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ template("chip_data_model") {
"${_app_root}/clusters/zll-level-control-server/zll-level-control-server.h",
"${_app_root}/clusters/zll-on-off-server/zll-on-off-server.h",
"${_app_root}/clusters/zll-scenes-server/zll-scenes-server.h",
"${_app_root}/encoder.cpp",
"${_app_root}/encoder-common.cpp",
"${_app_root}/reporting/reporting-default-configuration.cpp",
"${_app_root}/reporting/reporting-tokens.h",
"${_app_root}/reporting/reporting.cpp",
Expand All @@ -102,7 +102,7 @@ template("chip_data_model") {
"${_app_root}/util/af-event.cpp",
"${_app_root}/util/af-main-common.cpp",
"${_app_root}/util/attribute-list-byte-span.cpp",
"${_app_root}/util/attribute-size.cpp",
"${_app_root}/util/attribute-size-util.cpp",
"${_app_root}/util/attribute-storage.cpp",
"${_app_root}/util/attribute-table.cpp",
"${_app_root}/util/binding-table.cpp",
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 2255968

Please sign in to comment.