mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-21 23:47:39 +00:00
Make IDE recognize we are targeting Android
This commit is contained in:
parent
4c0f72f68f
commit
40aab13601
4
build.py
4
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)
|
||||
|
4
native/src/.cargo/config.toml
Normal file
4
native/src/.cargo/config.toml
Normal file
@ -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"
|
Loading…
x
Reference in New Issue
Block a user