# Configures the build to use the Android NDK toolchain if supplied on the command line import os import platform import subprocess import SCons compiler_suffix = "" if platform.system() == "Windows": compiler_suffix = ".cmd" toolchain_path = SCons.Script.Main.GetOption('android-toolchain-path') if not toolchain_path: print("Path to Android standalone toolchain must be set with --android-toolchain-path when using android_toolchain.vars") SCons.Script.Exit(1) CC=os.path.join(toolchain_path, "bin", "clang" + compiler_suffix) CXX=os.path.join(toolchain_path, "bin", "clang++" + compiler_suffix) AR=subprocess.check_output([CXX, '-print-prog-name=ar']).strip() LINKFLAGS='-static-libstdc++' TARGET_OS="android" TOOLS="gcc g++ gnulink ar gas" PROGSUFFIX = ""