Implement an Android NDK build of SwiftShader using the CMake files.

From the build directory, run:

  cmake -DCMAKE_TOOLCHAIN_FILE=../build/android.toolchain.cmake ..

Everything compiles and links. unittests, vk-unittests and ReactorUnitTests are known to work.
A "rundroid.sh" script is provided to upload and run Android binaries.
This CL has contains the first draft of an NDK-based FrameBuffer implementation.
It stubs out the gralloc calls in Image (consequence: EGLImage likely won't work).

NOTE: a small CMake patch is necessary; hopefully we'll find a way around this or land it in
CMake:

diff cmake-3.10/Modules/Platform/Android/Determine-Compiler-NDK.cmake.bak cmake-3.10/Modules/Platform/Android/Determine-Compiler-NDK.cmake
231c231
<   set(_ANDROID_TOOL_C_COMPILER_EXTERNAL_TOOLCHAIN ${CMAKE_ANDROID_NDK}/toolchains/${_ANDROID_TOOL_NAME}/prebuilt/${_ANDROID_HOST_DIR})
---
>   set(_ANDROID_TOOL_C_COMPILER_EXTERNAL_TOOLCHAIN ${CMAKE_ANDROID_NDK}/toolchains/${_ANDROID_TOOL_LLVM_NAME}/prebuilt/${_ANDROID_HOST_DIR})

Bug: b/129942368
Change-Id: I107a2f719256b6477ad105054ca68c676c05ec5c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27869
Presubmit-Ready: Stephen White <senorblanco@chromium.org>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/OpenGL/libEGL/libEGL.cpp b/src/OpenGL/libEGL/libEGL.cpp
index 912fe0c..51f5309 100644
--- a/src/OpenGL/libEGL/libEGL.cpp
+++ b/src/OpenGL/libEGL/libEGL.cpp
@@ -23,7 +23,7 @@
 #include "common/debug.h"
 #include "Common/Version.h"
 
-#if defined(__ANDROID__)
+#if defined(__ANDROID__) && !defined(ANDROID_NDK_BUILD)
 #include <system/window.h>
 #elif defined(USE_X11)
 #include "Main/libX11.hpp"
@@ -1170,7 +1170,7 @@
 		}
 	}
 
-	#if defined(__ANDROID__)
+	#if defined(__ANDROID__) && !defined(ANDROID_NDK_BUILD)
 		if(target == EGL_NATIVE_BUFFER_ANDROID)
 		{
 			ANativeWindowBuffer *nativeBuffer = reinterpret_cast<ANativeWindowBuffer*>(buffer);