summaryrefslogtreecommitdiff
path: root/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'build.py')
-rwxr-xr-xbuild.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/build.py b/build.py
index b121cad667..801c14759c 100755
--- a/build.py
+++ b/build.py
@@ -65,6 +65,7 @@ VALID_TARGETS = [
'docs', # Build Rust docs
'main', # Build the main C++ codebase
'prepare', # Prepare the output directory (gn gen + rust setup)
+ 'rootcanal', # Build Rust targets for RootCanal
'rust', # Build only the rust components + copy artifacts to output dir
'test', # Run the unit tests
'tools', # Build the host tools (i.e. packetgen)
@@ -433,6 +434,11 @@ class HostBuild():
"""
self._rust_build()
+ def _target_rootcanal(self):
+ """ Build rust artifacts for RootCanal in an already prepared environment.
+ """
+ self.run_command('rust', ['cargo', 'build'], cwd=os.path.join(self.platform_dir, 'bt/tools/rootcanal'), env=self.env)
+
def _target_main(self):
""" Build the main GN artifacts in an already prepared environment.
"""
@@ -447,6 +453,7 @@ class HostBuild():
rust_test_cmd = rust_test_cmd + [self.args.test_name]
self.run_command('test', rust_test_cmd, cwd=os.path.join(self.platform_dir, 'bt'), env=self.env)
+ self.run_command('test', rust_test_cmd, cwd=os.path.join(self.platform_dir, 'bt/tools/rootcanal'), env=self.env)
# Host tests second based on host test list
for t in HOST_TESTS:
@@ -542,6 +549,8 @@ class HostBuild():
self._target_prepare()
elif self.target == 'tools':
self._target_tools()
+ elif self.target == 'rootcanal':
+ self._target_rootcanal()
elif self.target == 'rust':
self._target_rust()
elif self.target == 'docs':