-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Qian Qian "Cubik" <cubik65536@cubik65536.top>
- Loading branch information
1 parent
59ca434
commit 63bcc1c
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- a/tools/rust/build_bindgen.py | ||
+++ b/tools/rust/build_bindgen.py | ||
@@ -28,8 +28,7 @@ from update import (RmTree) | ||
|
||
# The git hash to use. | ||
BINDGEN_GIT_VERSION = 'f93d5dfa6d5d7409bea584f3eab38e1fc52b8360' | ||
-BINDGEN_GIT_REPO = ('https://chromium.googlesource.com/external/' + | ||
- 'github.com/rust-lang/rust-bindgen') | ||
+BINDGEN_GIT_REPO = ('https://github.com/rust-lang/rust-bindgen') | ||
|
||
BINDGEN_SRC_DIR = os.path.join(THIRD_PARTY_DIR, 'rust-toolchain-intermediate', | ||
'bindgen-src') | ||
@@ -102,15 +101,8 @@ def RunCargo(cargo_args): | ||
f'the build_rust.py script builds rustc that is needed here.') | ||
sys.exit(1) | ||
|
||
- clang_bins_dir = os.path.join(RUST_HOST_LLVM_INSTALL_DIR, 'bin') | ||
- llvm_dir = RUST_HOST_LLVM_INSTALL_DIR | ||
- | ||
- if not os.path.exists(os.path.join(llvm_dir, 'bin', f'llvm-config{EXE}')): | ||
- print(f'Missing llvm-config in {llvm_dir}. This ' | ||
- f'script expects to be run after build_rust.py is run as ' | ||
- f'the build_rust.py script produces the LLVM libraries that ' | ||
- f'are needed here.') | ||
- sys.exit(1) | ||
+ clang_bins_dir = os.path.join(THIRD_PARTY_DIR, 'llvm-build', 'Release+Asserts', 'bin') | ||
+ llvm_dir = os.path.join(THIRD_PARTY_DIR, 'llvm-build', 'Release+Asserts') | ||
|
||
env = collections.defaultdict(str, os.environ) | ||
# Cargo normally stores files in $HOME. Override this. | ||
@@ -120,7 +112,6 @@ def RunCargo(cargo_args): | ||
env['RUSTC'] = rustc_bin | ||
|
||
# Use the LLVM libs and clang compiler from the rustc build. | ||
- env['LLVM_CONFIG_PATH'] = os.path.join(llvm_dir, 'bin', 'llvm-config') | ||
if sys.platform == 'win32': | ||
env['LIBCLANG_PATH'] = os.path.join(llvm_dir, 'bin') | ||
else: | ||
@@ -207,7 +198,7 @@ def main(): | ||
install_dir = os.path.join(RUST_TOOLCHAIN_OUT_DIR) | ||
print(f'Installing bindgen to {install_dir} ...') | ||
|
||
- llvm_dir = RUST_HOST_LLVM_INSTALL_DIR | ||
+ llvm_dir = os.path.join(THIRD_PARTY_DIR, 'llvm-build', 'Release+Asserts') | ||
shutil.copy( | ||
os.path.join(build_dir, RustTargetTriple(), 'release', | ||
f'bindgen{EXE}'), os.path.join(install_dir, 'bin')) |