summaryrefslogtreecommitdiff
path: root/etc/scons
diff options
context:
space:
mode:
Diffstat (limited to 'etc/scons')
-rw-r--r--etc/scons/android_ndk.vars24
1 files changed, 24 insertions, 0 deletions
diff --git a/etc/scons/android_ndk.vars b/etc/scons/android_ndk.vars
new file mode 100644
index 00000000000..ccbeaf376ba
--- /dev/null
+++ b/etc/scons/android_ndk.vars
@@ -0,0 +1,24 @@
+# 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_ndk.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()
+
+TARGET_OS="linux"
+TOOLS="gcc g++ gnulink ar gas"
+PROGSUFFIX = "" \ No newline at end of file