@@ -18,6 +18,7 @@ import("//build_overrides/openthread.gni")
18
18
19
19
import (" ${ chip_root } /src/crypto/crypto.gni" )
20
20
import (" ${ chip_root } /src/platform/device.gni" )
21
+ import (" ${ chip_root } /src/platform/nxp/common/ota/ota.gni" )
21
22
22
23
import (" ${ nxp_sdk_build_root } /nxp_sdk.gni" )
23
24
@@ -53,22 +54,7 @@ source_set("nxp_factory_data") {
53
54
source_set (" nxp_ota" ) {
54
55
public = [ " ../common/ota/OTAImageProcessorImpl.h" ]
55
56
56
- sources = [
57
- " ../common/ota/OTAFirmwareProcessor.cpp" ,
58
- " ../common/ota/OTAFirmwareProcessor.h" ,
59
- " ../common/ota/OTAHooks.cpp" ,
60
- " ../common/ota/OTAImageProcessorImpl.cpp" ,
61
- " ../common/ota/OTAImageProcessorImpl.h" ,
62
- " ../common/ota/OTATlvProcessor.cpp" ,
63
- " ../common/ota/OTATlvProcessor.h" ,
64
- ]
65
-
66
- if (nxp_use_factory_data && nxp_enable_ota_factory_data_processor ) {
67
- sources += [
68
- " ../common/ota/OTAFactoryDataProcessor.cpp" ,
69
- " ../common/ota/OTAFactoryDataProcessor.h" ,
70
- ]
71
- }
57
+ sources = ota_sources
72
58
73
59
deps = [
74
60
" :nxp_platform" ,
@@ -150,6 +136,12 @@ static_library("nxp_platform") {
150
136
]
151
137
}
152
138
139
+ # When the app is built using cmake, we must ensure the OTA platform files are also compiled.
140
+ # When the app is built using gn, the app selects the nxp_ota target through its build file.
141
+ if (nxp_external_sdk && chip_enable_ota_requestor ) {
142
+ sources += ota_sources
143
+ }
144
+
153
145
if (nxp_use_plain_dac_key ) {
154
146
defines += [ " CHIP_USE_PLAIN_DAC_KEY=1" ]
155
147
} else {
0 commit comments