Skip to content

Commit 4f430d0

Browse files
Update gn_silabs_example to use PW_ENVIRONMENT_ROOT's gn install if declared else default to the expected matter bootstrapped environment location
1 parent b6a1304 commit 4f430d0

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

scripts/examples/gn_silabs_example.sh

+10-8
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ else
2828
CHIP_ROOT="$MATTER_ROOT"
2929
fi
3030

31+
if [[ -z "${PW_ENVIRONMENT_ROOT}" ]]; then
32+
echo "Using the bootstrapped pigweed ENV in Matter root"
33+
PW_PATH="$CHIP_ROOT/.environment/cipd/packages/pigweed"
34+
else
35+
echo "Using provided $PW_ENVIRONMENT_ROOT as Pigweed ENV root"
36+
PW_PATH="$PW_ENVIRONMENT_ROOT"
37+
fi
38+
3139
set -x
3240
env
3341
USE_WIFI=false
3442
USE_DOCKER=false
3543
USE_GIT_SHA_FOR_VERSION=true
3644
USE_SLC=false
37-
GN_PATH=gn
38-
GN_PATH_PROVIDED=false
45+
GN_PATH="$PW_PATH/gn"
3946
USE_BOOTLOADER=false
4047
DOTFILE=".gn"
4148

@@ -270,7 +277,6 @@ else
270277
else
271278
GN_PATH="$2"
272279
fi
273-
GN_PATH_PROVIDED=true
274280
shift
275281
shift
276282
;;
@@ -310,11 +316,7 @@ else
310316
} &>/dev/null
311317
fi
312318

313-
if [ "$USE_SLC" == true ]; then
314-
if [ "$GN_PATH_PROVIDED" == false ]; then
315-
GN_PATH=./.environment/cipd/packages/pigweed/gn
316-
fi
317-
elif [ "$USE_SLC" == false ]; then
319+
if [ "$USE_SLC" == false ]; then
318320
# Activation needs to be after SLC generation which is done in gn gen.
319321
# Zap generation requires activation and is done in the build phase
320322
source "$CHIP_ROOT/scripts/activate.sh"

0 commit comments

Comments
 (0)