2
0
mirror of https://github.com/topjohnwu/Magisk synced 2025-09-05 04:25:10 +00:00

Proper Windows building support

This commit is contained in:
topjohnwu
2017-11-12 04:17:56 +08:00
parent 9a95652034
commit e79aa54b70
2 changed files with 15 additions and 12 deletions

View File

@@ -3,6 +3,10 @@ import sys
import os
import subprocess
if os.name == 'nt':
from colorama import init
init()
def error(str):
print('\n' + '\033[41m' + str + '\033[0m' + '\n')
sys.exit(1)
@@ -85,7 +89,7 @@ def build_binary(args):
ndk_build = os.path.join(os.environ['ANDROID_HOME'], 'ndk-bundle', 'ndk-build')
# Prebuild
proc = subprocess.run('PRECOMPILE=true {} {} -j{}'.format(ndk_build, cflag, multiprocessing.cpu_count()), shell=True)
proc = subprocess.run('{} PRECOMPILE=true {} -j{}'.format(ndk_build, cflag, multiprocessing.cpu_count()), shell=True)
if proc.returncode != 0:
error('Build Magisk binary failed!')