Skip to content

Commit

Permalink
Fix path conflicts in chip_data_model in some projects (project-chip#…
Browse files Browse the repository at this point in the history
…7590)

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 authored Jun 16, 2021
1 parent 41d5696 commit 35b5ce3
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/lighting-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ target_sources(app PRIVATE
${CHIP_ROOT}/src/app/util/af-event.cpp
${CHIP_ROOT}/src/app/util/af-main-common.cpp
${CHIP_ROOT}/src/app/util/attribute-list-byte-span.cpp
${CHIP_ROOT}/src/app/util/attribute-size.cpp
${CHIP_ROOT}/src/app/util/attribute-size-util.cpp
${CHIP_ROOT}/src/app/util/attribute-storage.cpp
${CHIP_ROOT}/src/app/util/attribute-table.cpp
${CHIP_ROOT}/src/app/util/binding-table.cpp
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ target_sources(app PRIVATE
${CHIP_ROOT}/src/app/util/af-event.cpp
${CHIP_ROOT}/src/app/util/af-main-common.cpp
${CHIP_ROOT}/src/app/util/attribute-list-byte-span.cpp
${CHIP_ROOT}/src/app/util/attribute-size.cpp
${CHIP_ROOT}/src/app/util/attribute-size-util.cpp
${CHIP_ROOT}/src/app/util/attribute-storage.cpp
${CHIP_ROOT}/src/app/util/attribute-table.cpp
${CHIP_ROOT}/src/app/util/binding-table.cpp
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ target_sources(app PRIVATE
${CHIP_ROOT}/src/app/util/af-event.cpp
${CHIP_ROOT}/src/app/util/af-main-common.cpp
${CHIP_ROOT}/src/app/util/attribute-list-byte-span.cpp
${CHIP_ROOT}/src/app/util/attribute-size.cpp
${CHIP_ROOT}/src/app/util/attribute-size-util.cpp
${CHIP_ROOT}/src/app/util/attribute-storage.cpp
${CHIP_ROOT}/src/app/util/attribute-table.cpp
${CHIP_ROOT}/src/app/util/binding-table.cpp
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ target_sources(app PRIVATE
${CHIP_ROOT}/src/app/util/af-event.cpp
${CHIP_ROOT}/src/app/util/af-main-common.cpp
${CHIP_ROOT}/src/app/util/attribute-list-byte-span.cpp
${CHIP_ROOT}/src/app/util/attribute-size.cpp
${CHIP_ROOT}/src/app/util/attribute-size-util.cpp
${CHIP_ROOT}/src/app/util/attribute-storage.cpp
${CHIP_ROOT}/src/app/util/attribute-table.cpp
${CHIP_ROOT}/src/app/util/binding-table.cpp
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-controller-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ target_sources(app PRIVATE
${CHIP_ROOT}/src/app/util/af-event.cpp
${CHIP_ROOT}/src/app/util/af-main-common.cpp
${CHIP_ROOT}/src/app/util/attribute-list-byte-span.cpp
${CHIP_ROOT}/src/app/util/attribute-size.cpp
${CHIP_ROOT}/src/app/util/attribute-size-util.cpp
${CHIP_ROOT}/src/app/util/attribute-storage.cpp
${CHIP_ROOT}/src/app/util/attribute-table.cpp
${CHIP_ROOT}/src/app/util/binding-table.cpp
Expand Down
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.
2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
1E85731C26551A490050A4D9 /* DataModelHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataModelHandler.cpp; path = ../../../app/util/DataModelHandler.cpp; sourceTree = "<group>"; };
1E85731D26551A490050A4D9 /* util.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = util.cpp; path = ../../../app/util/util.cpp; sourceTree = "<group>"; };
1E85731E26551A490050A4D9 /* ember-print.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "ember-print.cpp"; path = "../../../app/util/ember-print.cpp"; sourceTree = "<group>"; };
1E85731F26551A490050A4D9 /* attribute-size.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "attribute-size.cpp"; path = "../../../app/util/attribute-size.cpp"; sourceTree = "<group>"; };
1E85731F26551A490050A4D9 /* attribute-size.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "attribute-size-util.cpp"; path = "../../../app/util/attribute-size-util.cpp"; sourceTree = "<group>"; };
1E85732026551A490050A4D9 /* process-cluster-message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "process-cluster-message.cpp"; path = "../../../app/util/process-cluster-message.cpp"; sourceTree = "<group>"; };
1E85732126551A490050A4D9 /* chip-message-send.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "chip-message-send.cpp"; path = "../../../app/util/chip-message-send.cpp"; sourceTree = "<group>"; };
1E85733226551A700050A4D9 /* reporting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = reporting.cpp; path = ../../../app/reporting/reporting.cpp; sourceTree = "<group>"; };
Expand Down

0 comments on commit 35b5ce3

Please sign in to comment.