diff --git a/scripts/build/builders/telink.py b/scripts/build/builders/telink.py index 728d0dfb8338a9..8ec841285175f1 100644 --- a/scripts/build/builders/telink.py +++ b/scripts/build/builders/telink.py @@ -67,22 +67,26 @@ def __init__(self, self.app = app self.board = board - def generate(self): - if os.path.exists(self.output_dir): - return - + def get_cmd_prefixes(self): if not self._runner.dry_run: # Zephyr base if 'TELINK_ZEPHYR_BASE' not in os.environ: raise Exception("Telink builds require TELINK_ZEPHYR_BASE") - cmd = 'export ZEPHYR_BASE="$TELINK_ZEPHYR_BASE"\n' + cmd = 'export ZEPHYR_TOOLCHAIN_VARIANT=zephyr\n' + cmd += 'export ZEPHYR_BASE="$TELINK_ZEPHYR_BASE"\n' if 'TELINK_ZEPHYR_SDK_DIR' in os.environ: cmd += 'export ZEPHYR_SDK_INSTALL_DIR="$TELINK_ZEPHYR_SDK_DIR"\n' + return cmd + + def generate(self): + if os.path.exists(self.output_dir): + return + + cmd = self.get_cmd_prefixes() cmd += ''' -export ZEPHYR_TOOLCHAIN_VARIANT=zephyr source "$ZEPHYR_BASE/zephyr-env.sh"; west build --cmake-only -d {outdir} -b {board} {sourcedir} '''.format( @@ -97,8 +101,9 @@ def generate(self): def _build(self): logging.info('Compiling Telink at %s', self.output_dir) - self._Execute(['ninja', '-C', self.output_dir], - title='Building ' + self.identifier) + cmd = self.get_cmd_prefixes() + ("ninja -C %s" % self.output_dir) + + self._Execute(['bash', '-c', cmd], title='Building ' + self.identifier) def build_outputs(self): return { diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index d6548b7e44ffa6..1fa18a6a313842 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -1163,23 +1163,23 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/shell/qpg '--args=qpg_target_ic="qpg6105"' {out}/qpg-shell # Generating telink-tlsr9518adk80d-light -bash -c 'export ZEPHYR_BASE="$TELINK_ZEPHYR_BASE" +bash -c 'export ZEPHYR_TOOLCHAIN_VARIANT=zephyr +export ZEPHYR_BASE="$TELINK_ZEPHYR_BASE" export ZEPHYR_SDK_INSTALL_DIR="$TELINK_ZEPHYR_SDK_DIR" -export ZEPHYR_TOOLCHAIN_VARIANT=zephyr source "$ZEPHYR_BASE/zephyr-env.sh"; west build --cmake-only -d {out}/telink-tlsr9518adk80d-light -b tlsr9518adk80d {root}/examples/lighting-app/telink' # Generating telink-tlsr9518adk80d-light-switch -bash -c 'export ZEPHYR_BASE="$TELINK_ZEPHYR_BASE" +bash -c 'export ZEPHYR_TOOLCHAIN_VARIANT=zephyr +export ZEPHYR_BASE="$TELINK_ZEPHYR_BASE" export ZEPHYR_SDK_INSTALL_DIR="$TELINK_ZEPHYR_SDK_DIR" -export ZEPHYR_TOOLCHAIN_VARIANT=zephyr source "$ZEPHYR_BASE/zephyr-env.sh"; west build --cmake-only -d {out}/telink-tlsr9518adk80d-light-switch -b tlsr9518adk80d {root}/examples/light-switch-app/telink' # Generating telink-tlsr9518adk80d-ota-requestor -bash -c 'export ZEPHYR_BASE="$TELINK_ZEPHYR_BASE" +bash -c 'export ZEPHYR_TOOLCHAIN_VARIANT=zephyr +export ZEPHYR_BASE="$TELINK_ZEPHYR_BASE" export ZEPHYR_SDK_INSTALL_DIR="$TELINK_ZEPHYR_SDK_DIR" -export ZEPHYR_TOOLCHAIN_VARIANT=zephyr source "$ZEPHYR_BASE/zephyr-env.sh"; west build --cmake-only -d {out}/telink-tlsr9518adk80d-ota-requestor -b tlsr9518adk80d {root}/examples/ota-requestor-app/telink' @@ -2402,13 +2402,22 @@ ninja -C {out}/qpg-persistent-storage ninja -C {out}/qpg-shell # Building telink-tlsr9518adk80d-light -ninja -C {out}/telink-tlsr9518adk80d-light +bash -c 'export ZEPHYR_TOOLCHAIN_VARIANT=zephyr +export ZEPHYR_BASE="$TELINK_ZEPHYR_BASE" +export ZEPHYR_SDK_INSTALL_DIR="$TELINK_ZEPHYR_SDK_DIR" +ninja -C {out}/telink-tlsr9518adk80d-light' # Building telink-tlsr9518adk80d-light-switch -ninja -C {out}/telink-tlsr9518adk80d-light-switch +bash -c 'export ZEPHYR_TOOLCHAIN_VARIANT=zephyr +export ZEPHYR_BASE="$TELINK_ZEPHYR_BASE" +export ZEPHYR_SDK_INSTALL_DIR="$TELINK_ZEPHYR_SDK_DIR" +ninja -C {out}/telink-tlsr9518adk80d-light-switch' # Building telink-tlsr9518adk80d-ota-requestor -ninja -C {out}/telink-tlsr9518adk80d-ota-requestor +bash -c 'export ZEPHYR_TOOLCHAIN_VARIANT=zephyr +export ZEPHYR_BASE="$TELINK_ZEPHYR_BASE" +export ZEPHYR_SDK_INSTALL_DIR="$TELINK_ZEPHYR_SDK_DIR" +ninja -C {out}/telink-tlsr9518adk80d-ota-requestor' # Building tizen-arm-all-clusters ninja -C {out}/tizen-arm-all-clusters