From 573476101ff708961862b60d878e07423313b6f0 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Sat, 18 Mar 2023 12:35:57 -0400 Subject: [PATCH] use environment variables for EFR SDK root (#25730) * Use efr32 sdk root if available for building efr examples * Add a comment * Fix typo * Add shell escape * Use shell escape for the sdk root * Restyle --------- Co-authored-by: Andrei Litvin --- scripts/build/builders/efr32.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index f4aa05fc762842..d4eb7bfa0870d8 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -218,6 +218,12 @@ def __init__(self, self.extra_gn_options.append( 'sl_matter_version_str="v1.0-%s-%s"' % (branchName, shortCommitSha)) + if "GSDK_ROOT" in os.environ: + # EFR32 SDK is very large. If the SDK path is already known (the + # case for pre-installed images), use it directly. + sdk_path = shlex.quote(os.environ['GSDK_ROOT']) + self.extra_gn_options.append(f"efr32_sdk_root=\"{sdk_path}\"") + def GnBuildArgs(self): return self.extra_gn_options