Skip to content

Commit 223225f

Browse files
committed
Added patch to pass ndk platform includes to sdl2_image
1 parent ecf40dc commit 223225f

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

pythonforandroid/archs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def get_env(self, with_flags_in_cc=True):
6363
if self.ctx.ndk == 'crystax':
6464
env['LDFLAGS'] += ' -L{}/sources/crystax/libs/{} -lcrystax'.format(self.ctx.ndk_dir, self.arch)
6565

66+
# Pass the ndk platform include dir to Android.mk files if necessary
67+
env['NDK_PLATFORM_INCLUDE_DIR'] = join(self.ctx.ndk_platform, 'usr', 'include')
68+
6669
py_platform = sys.platform
6770
if py_platform in ['linux2', 'linux3']:
6871
py_platform = 'linux'

pythonforandroid/recipes/sdl2_image/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class LibSDL2Image(BootstrapNDKRecipe):
99

1010
patches = ['toggle_jpg_png_webp.patch',
1111
('disable_jpg.patch', is_arch('x86')),
12-
'extra_cflags.patch']
12+
'extra_cflags.patch',
13+
'add_ndk_platform_include_dir.patch']
1314

1415
recipe = LibSDL2Image()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/Android.mk b/Android.mk
2+
index d48111b..3108b2c 100644
3+
--- a/Android.mk
4+
+++ b/Android.mk
5+
@@ -22,7 +22,7 @@ SUPPORT_WEBP := false
6+
WEBP_LIBRARY_PATH := external/libwebp-0.3.0
7+
8+
9+
-LOCAL_C_INCLUDES := $(LOCAL_PATH)
10+
+LOCAL_C_INCLUDES := $(LOCAL_PATH) $(NDK_PLATFORM_INCLUDE_DIR)
11+
LOCAL_CFLAGS := -DLOAD_BMP -DLOAD_GIF -DLOAD_LBM -DLOAD_PCX -DLOAD_PNM \
12+
-DLOAD_TGA -DLOAD_XCF -DLOAD_XPM -DLOAD_XV
13+
LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays $(EXTRA_CFLAGS)

0 commit comments

Comments
 (0)