summaryrefslogtreecommitdiff
path: root/build.py
diff options
context:
space:
mode:
author Abhishek Pandit-Subedi <abhishekpandit@chromium.org> 2021-04-28 21:16:18 -0700
committer Abhishek Pandit-Subedi <abhishekpandit@google.com> 2021-05-17 22:14:52 +0000
commit1927afa4b3aa1221f76e48f7f534a7bad8565c01 (patch)
tree081046072154e89fc401a94fe58b06f50fa15148 /build.py
parentebf26de32df12ee6a5c62c06037f8bb69a8bd127 (diff)
Refactor topshim with bindgen and unsafe code
Writing topshim interfaces is very tedious and lots of code is duplicated in C++. Rather that depend on unsafe C++ code, we write a small amount of unsafe Rust code and use macros to interact with the native layer directly from Rust. A few major changes introduced in this patch: - Bindgen to get Rust interface into C - Macros to call raw pointer functions directly - Macros to handle converting a callback into an enum variant - Refactor code to use new data structures - Replace use of closures for callbacks with an enum and dispatch fn This change also updates the bindgen requirement to 0.57 to match what Android is already using. BYPASS_INCLUSIVE_LANGUAGE_REASON=Bindgen dependency provides this api Bug: 183208689 Tag: #floss Test: atest --host bluetooth_test_gd Change-Id: Iebe904ebc2643b48d1a371051fbf3c06f2bf04d4
Diffstat (limited to 'build.py')
-rwxr-xr-xbuild.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/build.py b/build.py
index c6cbabd369..808c80891d 100755
--- a/build.py
+++ b/build.py
@@ -180,6 +180,7 @@ class HostBuild():
self.env['CARGO_TARGET_DIR'] = self.output_dir
self.env['CARGO_HOME'] = os.path.join(self.output_dir, 'cargo_home')
self.env['RUSTFLAGS'] = self._generate_rustflags()
+ self.env['CXX_ROOT_PATH'] = os.path.join(self.platform_dir, 'bt')
# Configure some GN variables
if self.use_board: