mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07:39 +00:00
Proper build scripts
This commit is contained in:
parent
b9e89a1a2d
commit
a7ab8216ce
5
build.py
5
build.py
@ -231,10 +231,11 @@ def run_cargo_build(args):
|
|||||||
env['CARGO_BUILD_RUSTC'] = op.join(rust_bin, 'rustc' + EXE_EXT)
|
env['CARGO_BUILD_RUSTC'] = op.join(rust_bin, 'rustc' + EXE_EXT)
|
||||||
|
|
||||||
# Install cxxbridge and generate C++ bindings
|
# 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')
|
local_cargo_root = op.join(native_out, '.cargo')
|
||||||
mkdir_p(local_cargo_root)
|
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:
|
if not args.verbose:
|
||||||
cmds.append('-q')
|
cmds.append('-q')
|
||||||
proc = execv(cmds, env)
|
proc = execv(cmds, env)
|
||||||
|
@ -4,22 +4,30 @@ LOCAL_PATH := $(call my-dir)
|
|||||||
# Rust compilation outputs
|
# Rust compilation outputs
|
||||||
###########################
|
###########################
|
||||||
|
|
||||||
|
ifdef B_MAGISK
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := magisk-rs
|
LOCAL_MODULE := magisk-rs
|
||||||
LOCAL_SRC_FILES := ../out/$(TARGET_ARCH_ABI)/libmagisk-rs.a
|
LOCAL_SRC_FILES := ../out/$(TARGET_ARCH_ABI)/libmagisk-rs.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef B_BOOT
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := boot-rs
|
LOCAL_MODULE := boot-rs
|
||||||
LOCAL_SRC_FILES := ../out/$(TARGET_ARCH_ABI)/libmagiskboot-rs.a
|
LOCAL_SRC_FILES := ../out/$(TARGET_ARCH_ABI)/libmagiskboot-rs.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef B_INIT
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := init-rs
|
LOCAL_MODULE := init-rs
|
||||||
LOCAL_SRC_FILES := ../out/$(TARGET_ARCH_ABI)/libmagiskinit-rs.a
|
LOCAL_SRC_FILES := ../out/$(TARGET_ARCH_ABI)/libmagiskinit-rs.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef B_POLICY
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := policy-rs
|
LOCAL_MODULE := policy-rs
|
||||||
LOCAL_SRC_FILES := ../out/$(TARGET_ARCH_ABI)/libmagiskpolicy-rs.a
|
LOCAL_SRC_FILES := ../out/$(TARGET_ARCH_ABI)/libmagiskpolicy-rs.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user