Skip to content

Commit a6abb8f

Browse files
committed
build: exit on unsupported host OS for Android
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.
1 parent cbd6ddb commit a6abb8f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

android_configure.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ def patch_android():
5757
if platform.system() == "Darwin":
5858
host_os = "darwin"
5959
toolchain_path = android_ndk_path + "/toolchains/llvm/prebuilt/darwin-x86_64"
60-
6160
elif platform.system() == "Linux":
6261
host_os = "linux"
6362
toolchain_path = android_ndk_path + "/toolchains/llvm/prebuilt/linux-x86_64"
63+
else:
64+
print("\033[91mError: \033[0m" + "Unsupported host OS, must be one of: Linux, Darwin")
65+
sys.exit(1)
6466

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

0 commit comments

Comments
 (0)