Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to disable openthread in build_examples.py #20377

Merged
merged 1 commit into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/all-clusters-app/linux/main-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <new>
#include <platform/DiagnosticDataProvider.h>
#include <platform/PlatformManager.h>
#include <signal.h>
#include <system/SystemPacketBuffer.h>
#include <transport/SessionManager.h>
#include <transport/raw/PeerAddress.h>
Expand Down
5 changes: 5 additions & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def HostTargets():
builder.AppendVariant(name="ipv6only", enable_ipv4=False),
builder.AppendVariant(name="no-ble", enable_ble=False),
builder.AppendVariant(name="no-wifi", enable_wifi=False),
builder.AppendVariant(name="no-thread", enable_thread=False),
builder.AppendVariant(name="tsan", conflicts=['asan'], use_tsan=True),
builder.AppendVariant(name="asan", conflicts=['tsan'], use_asan=True),
builder.AppendVariant(name="libfuzzer", requires=[
Expand Down Expand Up @@ -305,6 +306,10 @@ def HostTargets():
yield target_native.Extend('address-resolve-tool-platform-mdns-ipv6only', app=HostApp.ADDRESS_RESOLVE,
use_platform_mdns=True, enable_ipv4=False).GlobBlacklist("Reduce default build variants")

nodeps_args = dict(enable_ipv4=False, enable_ble=False, enable_wifi=False, enable_thread=False)
yield target_native.Extend('chip-tool-nodeps', app=HostApp.CHIP_TOOL, **nodeps_args)
yield target_native.Extend('all-clusters-app-nodeps', app=HostApp.ALL_CLUSTERS, **nodeps_args)

test_target = Target(HostBoard.NATIVE.PlatformName(), HostBuilder)
for board in [HostBoard.NATIVE, HostBoard.FAKE]:
yield test_target.Extend(board.BoardName() + '-tests', board=board, app=HostApp.TESTS)
Expand Down
11 changes: 8 additions & 3 deletions scripts/build/builders/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,11 @@ def PlatformName(self):

class HostBuilder(GnBuilder):

def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_ipv4=True,
enable_ble=True, enable_wifi=True, use_tsan=False, use_asan=False, separate_event_loop=True,
use_libfuzzer=False, use_clang=False, interactive_mode=True, extra_tests=False,
def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE,
enable_ipv4=True, enable_ble=True, enable_wifi=True,
enable_thread=True, use_tsan=False, use_asan=False,
separate_event_loop=True, use_libfuzzer=False, use_clang=False,
interactive_mode=True, extra_tests=False,
use_platform_mdns=False, enable_rpcs=False):
super(HostBuilder, self).__init__(
root=os.path.join(root, 'examples', app.ExamplePath()),
Expand All @@ -216,6 +218,9 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_ip
if not enable_wifi:
self.extra_gn_options.append('chip_enable_wifi=false')

if not enable_thread:
self.extra_gn_options.append('chip_enable_openthread=false')

if use_tsan:
self.extra_gn_options.append('is_tsan=true')

Expand Down
12 changes: 12 additions & 0 deletions scripts/build/testdata/build_linux_on_x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root} {ou
# Generating linux-x64-all-clusters
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux {out}/linux-x64-all-clusters

# Generating linux-x64-all-clusters-app-nodeps
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux '--args=chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false' {out}/linux-x64-all-clusters-app-nodeps

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

Expand Down Expand Up @@ -180,6 +183,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa
# Generating linux-x64-chip-tool-no-interactive-ipv6only
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '--args=chip_inet_config_enable_ipv4=false config_use_interactive_mode=false' {out}/linux-x64-chip-tool-no-interactive-ipv6only

# Generating linux-x64-chip-tool-nodeps
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '--args=chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false' {out}/linux-x64-chip-tool-nodeps

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

Expand Down Expand Up @@ -351,6 +357,9 @@ ninja -C {out}/linux-x64-address-resolve-tool src/lib/address_resolve:address-re
# Building linux-x64-all-clusters
ninja -C {out}/linux-x64-all-clusters

# Building linux-x64-all-clusters-app-nodeps
ninja -C {out}/linux-x64-all-clusters-app-nodeps

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

Expand Down Expand Up @@ -378,6 +387,9 @@ ninja -C {out}/linux-x64-chip-tool-ipv6only
# Building linux-x64-chip-tool-no-interactive-ipv6only
ninja -C {out}/linux-x64-chip-tool-no-interactive-ipv6only

# Building linux-x64-chip-tool-nodeps
ninja -C {out}/linux-x64-chip-tool-nodeps

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

Expand Down