diff --git a/build.py b/build.py index 8074a2560..f26ba9648 100755 --- a/build.py +++ b/build.py @@ -232,6 +232,9 @@ def run_cargo_build(args): # Install cxxbridge and generate C++ bindings native_out = op.join('..', 'out') + cfg = op.join('.cargo', 'config.toml') + cfg_bak = op.join('.cargo', 'config.toml.bak') + mv(cfg, cfg_bak) cxx_src = op.join('external', 'cxx-rs', 'gen', 'cmd') local_cargo_root = op.join(native_out, '.cargo') mkdir_p(local_cargo_root) @@ -239,6 +242,7 @@ def run_cargo_build(args): if not args.verbose: cmds.append('-q') proc = execv(cmds, env) + mv(cfg_bak, cfg) if proc.returncode != 0: error('cxxbridge-cmd installation failed!') cxxbridge = op.join(local_cargo_root, 'bin', 'cxxbridge' + EXE_EXT) diff --git a/native/src/.cargo/config.toml b/native/src/.cargo/config.toml new file mode 100644 index 000000000..6f2e10465 --- /dev/null +++ b/native/src/.cargo/config.toml @@ -0,0 +1,4 @@ +[build] +# This is only used to make the IDE happy, the actual compilation will +# have the target overriden by command-line +target = "aarch64-linux-android"