Skip to content

Commit b244da8

Browse files
committed
add SDL_image 2.8.2
1 parent c993804 commit b244da8

File tree

382 files changed

+222637
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

382 files changed

+222637
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[submodule "external/jpeg"]
2+
path = external/jpeg
3+
url = https://github.com/libsdl-org/jpeg.git
4+
branch = v9e-SDL
5+
[submodule "external/libpng"]
6+
path = external/libpng
7+
url = https://github.com/libsdl-org/libpng.git
8+
branch = v1.6.40-SDL
9+
[submodule "external/libwebp"]
10+
path = external/libwebp
11+
url = https://github.com/libsdl-org/libwebp.git
12+
branch = 1.0.3-SDL
13+
[submodule "external/libtiff"]
14+
path = external/libtiff
15+
url = https://github.com/libsdl-org/libtiff.git
16+
branch = v4.2.0-SDL
17+
[submodule "external/zlib"]
18+
path = external/zlib
19+
url = https://github.com/libsdl-org/zlib.git
20+
branch = v1.3-SDL
21+
[submodule "external/libjxl"]
22+
path = external/libjxl
23+
url = https://github.com/libsdl-org/libjxl.git
24+
branch = v0.6.1-SDL
25+
[submodule "external/libavif"]
26+
path = external/libavif
27+
url = https://github.com/libsdl-org/libavif.git
28+
branch = v1.0.3-SDL
29+
[submodule "external/dav1d"]
30+
path = external/dav1d
31+
url = https://github.com/libsdl-org/dav1d.git
32+
branch = 1.2.1-SDL
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
SDL_IMAGE_LOCAL_PATH := $(call my-dir)
2+
3+
4+
# Enable this if you want PNG and JPG support with minimal dependencies
5+
USE_STBIMAGE ?= true
6+
7+
# The additional formats below require downloading third party dependencies,
8+
# using the external/download.sh script.
9+
10+
# Enable this if you want to support loading AVIF images
11+
# The library path should be a relative path to this directory.
12+
SUPPORT_AVIF ?= false
13+
AVIF_LIBRARY_PATH := external/libavif
14+
DAV1D_LIBRARY_PATH := external/dav1d
15+
16+
# Enable this if you want to support loading JPEG images using libjpeg
17+
# The library path should be a relative path to this directory.
18+
SUPPORT_JPG ?= false
19+
SUPPORT_SAVE_JPG ?= true
20+
JPG_LIBRARY_PATH := external/jpeg
21+
22+
# Enable this if you want to support loading JPEG-XL images
23+
# The library path should be a relative path to this directory.
24+
SUPPORT_JXL ?= false
25+
JXL_LIBRARY_PATH := external/libjxl
26+
27+
# Enable this if you want to support loading PNG images using libpng
28+
# The library path should be a relative path to this directory.
29+
SUPPORT_PNG ?= false
30+
SUPPORT_SAVE_PNG ?= true
31+
PNG_LIBRARY_PATH := external/libpng
32+
33+
# Enable this if you want to support loading WebP images
34+
# The library path should be a relative path to this directory.
35+
SUPPORT_WEBP ?= false
36+
WEBP_LIBRARY_PATH := external/libwebp
37+
38+
39+
# Build the library
40+
ifeq ($(SUPPORT_AVIF),true)
41+
include $(SDL_IMAGE_LOCAL_PATH)/$(AVIF_LIBRARY_PATH)/Android.mk
42+
include $(SDL_IMAGE_LOCAL_PATH)/$(DAV1D_LIBRARY_PATH)/Android.mk
43+
endif
44+
45+
# Build the library
46+
ifeq ($(SUPPORT_JPG),true)
47+
include $(SDL_IMAGE_LOCAL_PATH)/$(JPG_LIBRARY_PATH)/Android.mk
48+
endif
49+
50+
# Build the library
51+
ifeq ($(SUPPORT_JXL),true)
52+
include $(SDL_IMAGE_LOCAL_PATH)/$(JXL_LIBRARY_PATH)/Android.mk
53+
endif
54+
55+
# Build the library
56+
ifeq ($(SUPPORT_PNG),true)
57+
include $(SDL_IMAGE_LOCAL_PATH)/$(PNG_LIBRARY_PATH)/Android.mk
58+
endif
59+
60+
# Build the library
61+
ifeq ($(SUPPORT_WEBP),true)
62+
include $(SDL_IMAGE_LOCAL_PATH)/$(WEBP_LIBRARY_PATH)/Android.mk
63+
endif
64+
65+
66+
# Restore local path
67+
LOCAL_PATH := $(SDL_IMAGE_LOCAL_PATH)
68+
69+
include $(CLEAR_VARS)
70+
71+
LOCAL_MODULE := SDL2_image
72+
73+
LOCAL_SRC_FILES := \
74+
src/IMG.c \
75+
src/IMG_avif.c \
76+
src/IMG_bmp.c \
77+
src/IMG_gif.c \
78+
src/IMG_jpg.c \
79+
src/IMG_jxl.c \
80+
src/IMG_lbm.c \
81+
src/IMG_pcx.c \
82+
src/IMG_png.c \
83+
src/IMG_pnm.c \
84+
src/IMG_qoi.c \
85+
src/IMG_stb.c \
86+
src/IMG_svg.c \
87+
src/IMG_tga.c \
88+
src/IMG_tif.c \
89+
src/IMG_webp.c \
90+
src/IMG_WIC.c \
91+
src/IMG_xcf.c \
92+
src/IMG_xpm.c.arm \
93+
src/IMG_xv.c
94+
95+
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
96+
LOCAL_CFLAGS := -DLOAD_BMP -DLOAD_GIF -DLOAD_LBM -DLOAD_PCX -DLOAD_PNM \
97+
-DLOAD_SVG -DLOAD_TGA -DLOAD_XCF -DLOAD_XPM -DLOAD_XV \
98+
-DLOAD_QOI
99+
LOCAL_LDLIBS :=
100+
LOCAL_STATIC_LIBRARIES :=
101+
LOCAL_SHARED_LIBRARIES := SDL2
102+
103+
ifeq ($(USE_STBIMAGE),true)
104+
LOCAL_CFLAGS += -DLOAD_JPG -DLOAD_PNG -DUSE_STBIMAGE
105+
endif
106+
107+
ifeq ($(SUPPORT_AVIF),true)
108+
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(AVIF_LIBRARY_PATH)/include
109+
LOCAL_CFLAGS += -DLOAD_AVIF
110+
LOCAL_STATIC_LIBRARIES += avif
111+
LOCAL_WHOLE_STATIC_LIBRARIES += dav1d dav1d-8bit dav1d-16bit
112+
endif
113+
114+
ifeq ($(SUPPORT_JPG),true)
115+
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(JPG_LIBRARY_PATH)
116+
LOCAL_CFLAGS += -DLOAD_JPG
117+
LOCAL_STATIC_LIBRARIES += jpeg
118+
ifeq ($(SUPPORT_SAVE_JPG),true)
119+
LOCAL_CFLAGS += -DSDL_IMAGE_SAVE_JPG=1
120+
else
121+
LOCAL_CFLAGS += -DSDL_IMAGE_SAVE_JPG=0
122+
endif
123+
endif
124+
125+
ifeq ($(SUPPORT_JXL),true)
126+
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(JXL_LIBRARY_PATH)/lib/include \
127+
$(LOCAL_PATH)/$(JXL_LIBRARY_PATH)/android
128+
LOCAL_CFLAGS += -DLOAD_JXL
129+
LOCAL_STATIC_LIBRARIES += jxl
130+
endif
131+
132+
ifeq ($(SUPPORT_PNG),true)
133+
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(PNG_LIBRARY_PATH)
134+
LOCAL_CFLAGS += -DLOAD_PNG
135+
LOCAL_STATIC_LIBRARIES += png
136+
LOCAL_LDLIBS += -lz
137+
ifeq ($(SUPPORT_SAVE_PNG),true)
138+
LOCAL_CFLAGS += -DSDL_IMAGE_SAVE_PNG=1
139+
else
140+
LOCAL_CFLAGS += -DSDL_IMAGE_SAVE_PNG=0
141+
endif
142+
endif
143+
144+
ifeq ($(SUPPORT_WEBP),true)
145+
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(WEBP_LIBRARY_PATH)/src
146+
LOCAL_CFLAGS += -DLOAD_WEBP
147+
LOCAL_STATIC_LIBRARIES += webpdemux
148+
LOCAL_STATIC_LIBRARIES += webp
149+
endif
150+
151+
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/include
152+
153+
include $(BUILD_SHARED_LIBRARY)
154+
155+
###########################
156+
#
157+
# SDL2_image static library
158+
#
159+
###########################
160+
161+
LOCAL_MODULE := SDL2_image_static
162+
163+
LOCAL_MODULE_FILENAME := libSDL2_image
164+
165+
LOCAL_LDLIBS :=
166+
LOCAL_EXPORT_LDLIBS :=
167+
168+
include $(BUILD_STATIC_LIBRARY)

0 commit comments

Comments
 (0)