Skip to content

Commit

Permalink
Add bridge-app, modify tv-app and tv-casting-app targets in build_exa…
Browse files Browse the repository at this point in the history
…mples.py (#18136)

* Add lighting, tv-casting-app, bridge-app targets to build_examples.py

* Dropped -app suffix for new build targets

* Remove lighting and add testdata

* Add back -app to tv-casting-app target.

* Update build script unit test files

Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Dec 5, 2023
1 parent c6673f3 commit 4575169
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,6 @@ def HostTargets():
# Don't cross compile some builds
app_targets.append(
target_native.Extend('rpc-console', app=HostApp.RPC_CONSOLE))
app_targets.append(
target_native.Extend('tv-app', app=HostApp.TV_APP))
app_targets.append(
target_native.Extend('tv-casting-app', app=HostApp.TV_CASTING_APP))
app_targets.append(
target_native.Extend('nl-test-runner', app=HostApp.NL_TEST_RUNNER))

Expand All @@ -258,6 +254,9 @@ def HostTargets():
app_targets.append(target.Extend(
'ota-requestor', app=HostApp.OTA_REQUESTOR, enable_ble=False))
app_targets.append(target.Extend('python-bindings', app=HostApp.PYTHON_BINDINGS))
app_targets.append(target.Extend('tv-app', app=HostApp.TV_APP))
app_targets.append(target.Extend('tv-casting-app', app=HostApp.TV_CASTING))
app_targets.append(target.Extend('bridge', app=HostApp.BRIDGE))

builder = VariantBuilder()

Expand Down
15 changes: 15 additions & 0 deletions scripts/build/builders/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class HostApp(Enum):
OTA_REQUESTOR = auto()
PYTHON_BINDINGS = auto()
NL_TEST_RUNNER = auto()
TV_CASTING = auto()
BRIDGE = auto()

def ExamplePath(self):
if self == HostApp.ALL_CLUSTERS:
Expand Down Expand Up @@ -73,6 +75,10 @@ def ExamplePath(self):
return '../'
elif self == HostApp.NL_TEST_RUNNER:
return '../src/test_driver/efr32'
elif self == HostApp.TV_CASTING:
return 'tv-casting-app/linux'
elif self == HostApp.BRIDGE:
return 'bridge-app/linux'
else:
raise Exception('Unknown app type: %r' % self)

Expand Down Expand Up @@ -134,6 +140,15 @@ def OutputNames(self):
yield 'controller/python' # Directory containing WHL files
elif self == HostApp.NL_TEST_RUNNER:
yield 'chip_nl_test_runner_wheels'
elif self == HostApp.LIGHTING:
yield 'chip-lighting-app'
yield 'chip-lighting-app.map'
elif self == HostApp.TV_CASTING_APP:
yield 'chip-tv-casting-app'
yield 'chip-tv-casting-app.map'
elif self == HostApp.BRIDGE_APP:
yield 'chip-bridge-app'
yield 'chip-bridge-app.map'
else:
raise Exception('Unknown app type: %r' % self)

Expand Down
60 changes: 60 additions & 0 deletions scripts/build/testdata/build_linux_on_x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-minimal-app/linux '"'"'--args=chip_inet_config_enable_ipv4=false target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-all-clusters-minimal-ipv6only'

# Generating linux-arm64-bridge
bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/bridge-app/linux '"'"'--args=target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-bridge'

# Generating linux-arm64-bridge-ipv6only
bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/bridge-app/linux '"'"'--args=chip_inet_config_enable_ipv4=false target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-bridge-ipv6only'

# Generating linux-arm64-chip-tool-no-interactive-ipv6only
bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
Expand Down Expand Up @@ -101,6 +111,26 @@ bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/thermostat/linux '"'"'--args=chip_inet_config_enable_ipv4=false target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-thermostat-ipv6only'

# Generating linux-arm64-tv-app
bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/tv-app/linux '"'"'--args=target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-tv-app'

# Generating linux-arm64-tv-app-ipv6only
bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/tv-app/linux '"'"'--args=chip_inet_config_enable_ipv4=false target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-tv-app-ipv6only'

# Generating linux-arm64-tv-casting-app
bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/tv-casting-app/linux '"'"'--args=target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-tv-casting-app'

# Generating linux-arm64-tv-casting-app-ipv6only
bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/tv-casting-app/linux '"'"'--args=chip_inet_config_enable_ipv4=false target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-tv-casting-app-ipv6only'

# Generating linux-fake-tests
gn gen --check --fail-on-unused-args --export-compile-commands --root={root} '--args=chip_build_tests=true custom_toolchain="//build/toolchain/fake:fake_x64_gcc" chip_link_tests=true chip_device_platform="fake"' {out}/linux-fake-tests

Expand All @@ -119,6 +149,12 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa
# Generating linux-x64-all-clusters-minimal-ipv6only
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-minimal-app/linux --args=chip_inet_config_enable_ipv4=false {out}/linux-x64-all-clusters-minimal-ipv6only

# Generating linux-x64-bridge
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/bridge-app/linux {out}/linux-x64-bridge

# Generating linux-x64-bridge-ipv6only
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/bridge-app/linux --args=chip_inet_config_enable_ipv4=false {out}/linux-x64-bridge-ipv6only

# Generating linux-x64-chip-cert
gn gen --check --fail-on-unused-args --export-compile-commands --root={root} '--args=chip_crypto="openssl"' {out}/linux-x64-chip-cert

Expand Down Expand Up @@ -209,6 +245,12 @@ ninja -C {out}/linux-arm64-all-clusters-minimal
# Building linux-arm64-all-clusters-minimal-ipv6only
ninja -C {out}/linux-arm64-all-clusters-minimal-ipv6only

# Building linux-arm64-bridge
ninja -C {out}/linux-arm64-bridge

# Building linux-arm64-bridge-ipv6only
ninja -C {out}/linux-arm64-bridge-ipv6only

# Building linux-arm64-chip-tool-no-interactive-ipv6only
ninja -C {out}/linux-arm64-chip-tool-no-interactive-ipv6only

Expand Down Expand Up @@ -257,6 +299,18 @@ ninja -C {out}/linux-arm64-thermostat
# Building linux-arm64-thermostat-ipv6only
ninja -C {out}/linux-arm64-thermostat-ipv6only

# Building linux-arm64-tv-app
ninja -C {out}/linux-arm64-tv-app

# Building linux-arm64-tv-app-ipv6only
ninja -C {out}/linux-arm64-tv-app-ipv6only

# Building linux-arm64-tv-casting-app
ninja -C {out}/linux-arm64-tv-casting-app

# Building linux-arm64-tv-casting-app-ipv6only
ninja -C {out}/linux-arm64-tv-casting-app-ipv6only

# Building linux-fake-tests
ninja -C {out}/linux-fake-tests check

Expand All @@ -275,6 +329,12 @@ ninja -C {out}/linux-x64-all-clusters-minimal
# Building linux-x64-all-clusters-minimal-ipv6only
ninja -C {out}/linux-x64-all-clusters-minimal-ipv6only

# Building linux-x64-bridge
ninja -C {out}/linux-x64-bridge

# Building linux-x64-bridge-ipv6only
ninja -C {out}/linux-x64-bridge-ipv6only

# Building linux-x64-chip-cert
ninja -C {out}/linux-x64-chip-cert src/tools/chip-cert

Expand Down

0 comments on commit 4575169

Please sign in to comment.