mirror of
https://github.com/apernet/hysteria.git
synced 2025-04-03 04:27:39 +03:00
feat: add android build
This commit is contained in:
parent
7ae977866a
commit
a28234a21a
4 changed files with 37 additions and 2 deletions
15
hyperbole.py
15
hyperbole.py
|
@ -168,7 +168,6 @@ def get_app_platforms():
|
|||
result.append((parts[0], parts[1]))
|
||||
return result
|
||||
|
||||
|
||||
def cmd_build(pprof=False, release=False):
|
||||
if not check_build_env():
|
||||
return
|
||||
|
@ -204,13 +203,25 @@ def cmd_build(pprof=False, release=False):
|
|||
out_name += ".exe"
|
||||
|
||||
env = os.environ.copy()
|
||||
env["CGO_ENABLED"] = "0"
|
||||
env["GOOS"] = os_name
|
||||
if arch in ARCH_ALIASES:
|
||||
for k, v in ARCH_ALIASES[arch].items():
|
||||
env[k] = v
|
||||
else:
|
||||
env["GOARCH"] = arch
|
||||
if os_name == "android":
|
||||
env["CGO_ENABLED"] = "1"
|
||||
ANDROID_NDK_HOME = os.environ.get("ANDROID_NDK_HOME") + "/toolchains/llvm/prebuilt/linux-x86_64/bin"
|
||||
if arch == "arm64" :
|
||||
env["CC"] = ANDROID_NDK_HOME + "/aarch64-linux-android33-clang"
|
||||
if arch == "armv7" :
|
||||
env["CC"] = ANDROID_NDK_HOME + "/armv7a-linux-androideabi33-clang"
|
||||
if arch == "386" :
|
||||
env["CC"] = ANDROID_NDK_HOME + "/i686-linux-android33-clang"
|
||||
if arch == "amd64" :
|
||||
env["CC"] = ANDROID_NDK_HOME + "/x86_64-linux-android33-clang"
|
||||
else:
|
||||
env["CGO_ENABLED"] = "0"
|
||||
|
||||
plat_ldflags = ldflags.copy()
|
||||
plat_ldflags.append("-X")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue