aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-03 13:08:29 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-03 13:08:29 +0000
commit58629291bc145edca8fb303e465c8537bed65314 (patch)
tree410475666d60f96be79478d3a553bcbf12aff743 /include/core
parentd0601d2e7dd478d9cca46595afc00782cd97b82b (diff)
Adding support to trunk for building Skia using the Android NDK.
This CL depends on a subsequent CL to add the appropriate NDK toolchain and system sources to the skia repo. Review URL: http://codereview.appspot.com/5306089/ Review URL: http://codereview.appspot.com/5306089 git-svn-id: http://skia.googlecode.com/svn/trunk@2592 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkOSFile.h4
-rw-r--r--include/core/SkPreConfig.h13
2 files changed, 13 insertions, 4 deletions
diff --git a/include/core/SkOSFile.h b/include/core/SkOSFile.h
index 2a08b8e30f..9f01ead683 100644
--- a/include/core/SkOSFile.h
+++ b/include/core/SkOSFile.h
@@ -13,7 +13,7 @@
#include "SkString.h"
-#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX)
+#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID)
#include <dirent.h>
#endif
@@ -58,7 +58,7 @@ public:
#ifdef SK_BUILD_FOR_WIN
HANDLE fHandle;
uint16_t* fPath16;
-#elif defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX)
+#elif defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID)
DIR* fDIR;
SkString fPath, fSuffix;
#endif
diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h
index f8f4f62c52..11d2c5287a 100644
--- a/include/core/SkPreConfig.h
+++ b/include/core/SkPreConfig.h
@@ -16,7 +16,7 @@
//////////////////////////////////////////////////////////////////////
-#if !defined(SK_BUILD_FOR_ANDROID_NDK) && !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_PALM) && !defined(SK_BUILD_FOR_WINCE) && !defined(SK_BUILD_FOR_WIN32) && !defined(SK_BUILD_FOR_SYMBIAN) && !defined(SK_BUILD_FOR_UNIX) && !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_SDL) && !defined(SK_BUILD_FOR_BREW)
+#if !defined(SK_BUILD_FOR_ANDROID) && !defined(SK_BUILD_FOR_ANDROID_NDK) && !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_PALM) && !defined(SK_BUILD_FOR_WINCE) && !defined(SK_BUILD_FOR_WIN32) && !defined(SK_BUILD_FOR_SYMBIAN) && !defined(SK_BUILD_FOR_UNIX) && !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_SDL) && !defined(SK_BUILD_FOR_BREW)
#ifdef __APPLE__
#include "TargetConditionals.h"
@@ -36,7 +36,7 @@
#define SK_BUILD_FOR_IOS
#elif defined(ANDROID_NDK)
#define SK_BUILD_FOR_ANDROID_NDK
- #elif defined(ANROID)
+ #elif defined(ANDROID)
#define SK_BUILD_FOR_ANDROID
#else
#define SK_BUILD_FOR_MAC
@@ -44,6 +44,15 @@
#endif
+/* Even if the user only defined the NDK variant we still need to build
+ * the default Android code. Therefore, when attempting to include/exclude
+ * something from the NDK variant check first that we are building for
+ * Android then check the status of the NDK define.
+ */
+#if defined(SK_BUILD_FOR_ANDROID_NDK) && !defined(SK_BUILD_FOR_ANDROID)
+ #define SK_BUILD_FOR_ANDROID
+#endif
+
//////////////////////////////////////////////////////////////////////
#if !defined(SK_DEBUG) && !defined(SK_RELEASE)