@@ -146,11 +146,12 @@ if [ "$BUILD_TYPE" != "all" ]; then
146146 # Target Features Configs
147147 for target_json in ` jq -c ' .targets[]' configs/builds.json` ; do
148148 target=$( echo " $target_json " | jq -c ' .target' | tr -d ' "' )
149+ export CHIP_VARIANT=$( echo " $target_json " | jq -c ' .chip_variant // "' $target ' "' | tr -d ' "' )
149150
150- # Check if $target is in the $TARGET array
151+ # Check if $CHIP_VARIANT is in the $TARGET array
151152 target_in_array=false
152153 for item in " ${TARGET[@]} " ; do
153- if [ " $item " = " $target " ]; then
154+ if [ " $item " = " $CHIP_VARIANT " ]; then
154155 target_in_array=true
155156 break
156157 fi
@@ -161,12 +162,12 @@ if [ "$BUILD_TYPE" != "all" ]; then
161162 continue
162163 fi
163164
164- configs=" configs/defconfig.common;configs/defconfig.$target ;configs/defconfig.debug_$BUILD_DEBUG "
165+ configs=" configs/defconfig.common;configs/defconfig.$CHIP_VARIANT ;configs/defconfig.debug_$BUILD_DEBUG "
165166 for defconf in ` echo " $target_json " | jq -c ' .features[]' | tr -d ' "' ` ; do
166167 configs=" $configs ;configs/defconfig.$defconf "
167168 done
168169
169- echo " * Building for $target "
170+ echo " * Building for target: ' $target ', variant: ' $CHIP_VARIANT ' "
170171
171172 # Configs From Arguments
172173 for conf in $CONFIGS ; do
@@ -187,36 +188,37 @@ mkdir -p "$AR_TOOLS/esp32-arduino-libs"
187188# targets_count=`jq -c '.targets[] | length' configs/builds.json`
188189for target_json in ` jq -c ' .targets[]' configs/builds.json` ; do
189190 target=$( echo " $target_json " | jq -c ' .target' | tr -d ' "' )
191+ export CHIP_VARIANT=$( echo " $target_json " | jq -c ' .chip_variant // "' $target ' "' | tr -d ' "' )
190192 target_skip=$( echo " $target_json " | jq -c ' .skip // 0' )
191193
192- # Check if $target is in the $TARGET array if not "all"
194+ # Check if $CHIP_VARIANT is in the $TARGET array if not "all"
193195 if [ " $TARGET " != " all" ]; then
194196 target_in_array=false
195197 for item in " ${TARGET[@]} " ; do
196- if [ " $item " = " $target " ]; then
198+ if [ " $item " = " $CHIP_VARIANT " ]; then
197199 target_in_array=true
198200 break
199201 fi
200202 done
201203
202- # If $target is not in the $TARGET array, skip processing
204+ # If $CHIP_VARIANT is not in the $TARGET array, skip processing
203205 if [ " $target_in_array " = false ]; then
204- echo " * Skipping Target: $target "
206+ echo " * Skipping Target: $CHIP_VARIANT "
205207 continue
206208 fi
207209 fi
208210
209211 # Skip chips that should not be a part of the final libs
210212 # WARNING!!! this logic needs to be updated when cron builds are split into jobs
211213 if [ " $TARGET " = " all" ] && [ $target_skip -eq 1 ]; then
212- echo " * Skipping Target: $target "
214+ echo " * Skipping Target: $CHIP_VARIANT "
213215 continue
214216 fi
215217
216- echo " * Target: $target "
218+ echo " * Target: ' $target ', Variant: ' $CHIP_VARIANT ' "
217219
218220 # Build Main Configs List
219- main_configs=" configs/defconfig.common;configs/defconfig.$target ;configs/defconfig.debug_$BUILD_DEBUG "
221+ main_configs=" configs/defconfig.common;configs/defconfig.$CHIP_VARIANT ;configs/defconfig.debug_$BUILD_DEBUG "
220222 for defconf in ` echo " $target_json " | jq -c ' .features[]' | tr -d ' "' ` ; do
221223 main_configs=" $main_configs ;configs/defconfig.$defconf "
222224 done
@@ -233,15 +235,15 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
233235 if [ $? -ne 0 ]; then exit 1; fi
234236
235237 # Build ESP-Hosted slave firmwares
236- if [ " $target " == " esp32p4" ]; then
238+ if [ " $CHIP_VARIANT " == " esp32p4" ]; then
237239 ./tools/build-hosted.sh
238240 fi
239241
240242 # Build ESP-SR Models
241243 if [ " $target " == " esp32s3" ] || [ " $target " == " esp32p4" ]; then
242244 idf.py -DIDF_TARGET=" $target " -DSDKCONFIG_DEFAULTS=" $idf_libs_configs " srmodels_bin
243245 if [ $? -ne 0 ]; then exit 1; fi
244- AR_SDK=" $AR_TOOLS /esp32-arduino-libs/$target "
246+ AR_SDK=" $AR_TOOLS /esp32-arduino-libs/$CHIP_VARIANT "
245247 # sr model.bin
246248 if [ -f " build/srmodels/srmodels.bin" ]; then
247249 echo " $AR_SDK /esp_sr"
0 commit comments