3 Get the toolchains path
4 https://proandroiddev.com/tutorial-compile-openssl-to-1-1-1-for-android-application-87137968fee
15 def get_host_tag_or_die():
16 """Return the host tag for this platform. Die if not supported."""
17 if sys.platform.startswith('linux'):
19 elif sys.platform == 'darwin':
20 return 'darwin-x86_64'
21 elif sys.platform == 'win32' or sys.platform == 'cygwin':
22 host_tag = 'windows-x86_64'
23 if not os.path.exists(os.path.join(NDK_DIR, 'prebuilt', host_tag)):
26 sys.exit('Unsupported platform: ' + sys.platform)
29 def get_toolchain_path_or_die(ndk, host_tag):
30 """Return the toolchain path or die."""
31 toolchain_path = os.path.join(ndk, 'toolchains/llvm/prebuilt',
33 if not os.path.exists(toolchain_path):
34 sys.exit('Could not find toolchain: {}'.format(toolchain_path))
38 """Program entry point."""
39 parser = argparse.ArgumentParser(description='Optional app description')
40 parser.add_argument('--ndk', required=True,
41 help='The NDK Home directory')
42 args = parser.parse_args()
44 host_tag = get_host_tag_or_die()
45 toolchain_path = get_toolchain_path_or_die(args.ndk, host_tag)
48 if __name__ == '__main__':