diff options
author | 2022-08-10 11:07:12 +0100 | |
---|---|---|
committer | 2022-08-24 18:31:50 +0000 | |
commit | d7b6b6d320b69114407ac5a6871ead5c9cb5629e (patch) | |
tree | 110ebdbc3596896ca5c4a4fad2b118fc2129a3ce /build.py | |
parent | cc594596fb22d54596487e2102bedb613421ea43 (diff) |
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
Diffstat (limited to 'build.py')
-rwxr-xr-x | build.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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': |