Skip to content

Commit

Permalink
build: exit on unsupported host OS for Android
Browse files Browse the repository at this point in the history
The Android configure script throws an unhelpful error message telling
the user that `toolchain_path` is not defined when the script is run on
an unsupported host OS, exit with a more helpful message instead while
listing the supported host OSes.
  • Loading branch information
VoltrexKeyva committed May 11, 2024
1 parent cbd6ddb commit a6abb8f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion android_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ def patch_android():
if platform.system() == "Darwin":
host_os = "darwin"
toolchain_path = android_ndk_path + "/toolchains/llvm/prebuilt/darwin-x86_64"

elif platform.system() == "Linux":
host_os = "linux"
toolchain_path = android_ndk_path + "/toolchains/llvm/prebuilt/linux-x86_64"
else:
print("\033[91mError: \033[0m" + "Unsupported host OS, must be one of: Linux, Darwin")
sys.exit(1)

os.environ['PATH'] += os.pathsep + toolchain_path + "/bin"
os.environ['CC'] = toolchain_path + "/bin/" + TOOLCHAIN_PREFIX + android_sdk_version + "-" + "clang"
Expand Down

0 comments on commit a6abb8f

Please sign in to comment.