diff --git a/build.py b/build.py index 224ad1ddd..0f271c774 100755 --- a/build.py +++ b/build.py @@ -231,10 +231,11 @@ def run_cargo_build(args): env['CARGO_BUILD_RUSTC'] = op.join(rust_bin, 'rustc' + EXE_EXT) # Install cxxbridge and generate C++ bindings - native_out = op.join('..', '..', 'native', 'out') + native_out = op.join('..', 'out') + cxx_src = op.join('external', 'cxx-rs', 'gen', 'cmd') local_cargo_root = op.join(native_out, '.cargo') mkdir_p(local_cargo_root) - cmds = [cargo, 'install', '--root', local_cargo_root, 'cxxbridge-cmd'] + cmds = [cargo, 'install', '--root', local_cargo_root, '--path', cxx_src] if not args.verbose: cmds.append('-q') proc = execv(cmds, env) diff --git a/native/src/Android-rs.mk b/native/src/Android-rs.mk index 51b8db2c6..c705e46c0 100644 --- a/native/src/Android-rs.mk +++ b/native/src/Android-rs.mk @@ -4,22 +4,30 @@ LOCAL_PATH := $(call my-dir) # Rust compilation outputs ########################### +ifdef B_MAGISK include $(CLEAR_VARS) LOCAL_MODULE := magisk-rs LOCAL_SRC_FILES := ../out/$(TARGET_ARCH_ABI)/libmagisk-rs.a include $(PREBUILT_STATIC_LIBRARY) +endif +ifdef B_BOOT include $(CLEAR_VARS) LOCAL_MODULE := boot-rs LOCAL_SRC_FILES := ../out/$(TARGET_ARCH_ABI)/libmagiskboot-rs.a include $(PREBUILT_STATIC_LIBRARY) +endif +ifdef B_INIT include $(CLEAR_VARS) LOCAL_MODULE := init-rs LOCAL_SRC_FILES := ../out/$(TARGET_ARCH_ABI)/libmagiskinit-rs.a include $(PREBUILT_STATIC_LIBRARY) +endif +ifdef B_POLICY include $(CLEAR_VARS) LOCAL_MODULE := policy-rs LOCAL_SRC_FILES := ../out/$(TARGET_ARCH_ABI)/libmagiskpolicy-rs.a include $(PREBUILT_STATIC_LIBRARY) +endif