From d7b6b6d320b69114407ac5a6871ead5c9cb5629e Mon Sep 17 00:00:00 2001 From: Ivan Podogov Date: Wed, 10 Aug 2022 11:07:12 +0100 Subject: Add support for cargo build of LMP This change adds an option to skip generating Bluetooth packets using bluetooth_packetgen if these were already built in advance. It also adds crate definition for liblmp, similar to bt_packets. Bug: 238726856 Tag: #floss Test: cargo build Change-Id: Ib099b56c0eb39c37cb459132ddf2a813cb63ebf6 --- build.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'build.py') 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': -- cgit v1.2.3-59-g8ed1b