Android.mk
author Ozkan Sezer <sezeroz@gmail.com>
Sat, 13 Oct 2018 15:02:56 +0300
changeset 596 4b70bfe18fb7
parent 588 960662a9dbdc
child 627 34a3f499aff4
permissions -rw-r--r--
fix build against libpng-1.5.x versions.
slouken@588
     1
SDL_IMAGE_LOCAL_PATH := $(call my-dir)
slouken@257
     2
slouken@257
     3
slouken@378
     4
# Enable this if you want to support loading JPEG images
slouken@378
     5
# The library path should be a relative path to this directory.
slouken@442
     6
SUPPORT_JPG ?= true
slouken@522
     7
JPG_LIBRARY_PATH := external/jpeg-9b
slouken@378
     8
slouken@378
     9
# Enable this if you want to support loading PNG images
slouken@378
    10
# The library path should be a relative path to this directory.
slouken@442
    11
SUPPORT_PNG ?= true
slouken@522
    12
PNG_LIBRARY_PATH := external/libpng-1.6.32
slouken@378
    13
slouken@378
    14
# Enable this if you want to support loading WebP images
slouken@378
    15
# The library path should be a relative path to this directory.
slouken@534
    16
SUPPORT_WEBP ?= true
slouken@522
    17
WEBP_LIBRARY_PATH := external/libwebp-0.6.0
slouken@378
    18
slouken@386
    19
slouken@534
    20
# Build the library
slouken@534
    21
ifeq ($(SUPPORT_JPG),true)
slouken@588
    22
    include $(SDL_IMAGE_LOCAL_PATH)/$(JPG_LIBRARY_PATH)/Android.mk
slouken@534
    23
endif
slouken@534
    24
slouken@534
    25
# Build the library
slouken@534
    26
ifeq ($(SUPPORT_PNG),true)
slouken@588
    27
    include $(SDL_IMAGE_LOCAL_PATH)/$(PNG_LIBRARY_PATH)/Android.mk
slouken@534
    28
endif
slouken@534
    29
slouken@534
    30
# Build the library
slouken@534
    31
ifeq ($(SUPPORT_WEBP),true)
slouken@588
    32
    include $(SDL_IMAGE_LOCAL_PATH)/$(WEBP_LIBRARY_PATH)/Android.mk
slouken@534
    33
endif
slouken@534
    34
slouken@534
    35
slouken@534
    36
# Restore local path
slouken@588
    37
LOCAL_PATH := $(SDL_IMAGE_LOCAL_PATH)
slouken@534
    38
slouken@534
    39
include $(CLEAR_VARS)
slouken@534
    40
slouken@534
    41
LOCAL_MODULE := SDL2_image
slouken@257
    42
slouken@543
    43
LOCAL_SRC_FILES :=  \
slouken@543
    44
    IMG.c           \
slouken@543
    45
    IMG_bmp.c       \
slouken@543
    46
    IMG_gif.c       \
slouken@543
    47
    IMG_jpg.c       \
slouken@543
    48
    IMG_lbm.c       \
slouken@543
    49
    IMG_pcx.c       \
slouken@543
    50
    IMG_png.c       \
slouken@543
    51
    IMG_pnm.c       \
slouken@543
    52
    IMG_svg.c       \
slouken@543
    53
    IMG_tga.c       \
slouken@543
    54
    IMG_tif.c       \
slouken@543
    55
    IMG_webp.c      \
slouken@543
    56
    IMG_WIC.c       \
slouken@543
    57
    IMG_xcf.c       \
slouken@543
    58
    IMG_xpm.c.arm   \
slouken@543
    59
    IMG_xv.c        \
slouken@543
    60
    IMG_xxx.c
slouken@257
    61
slouken@534
    62
LOCAL_CFLAGS := -DLOAD_BMP -DLOAD_GIF -DLOAD_LBM -DLOAD_PCX -DLOAD_PNM \
slouken@534
    63
                -DLOAD_SVG -DLOAD_TGA -DLOAD_XCF -DLOAD_XPM -DLOAD_XV
slouken@378
    64
LOCAL_LDLIBS :=
slouken@378
    65
LOCAL_STATIC_LIBRARIES :=
slouken@329
    66
LOCAL_SHARED_LIBRARIES := SDL2
slouken@257
    67
slouken@378
    68
ifeq ($(SUPPORT_JPG),true)
slouken@386
    69
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(JPG_LIBRARY_PATH)
slouken@386
    70
    LOCAL_CFLAGS += -DLOAD_JPG
slouken@534
    71
    LOCAL_STATIC_LIBRARIES += jpeg
slouken@378
    72
endif
slouken@257
    73
slouken@378
    74
ifeq ($(SUPPORT_PNG),true)
slouken@386
    75
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(PNG_LIBRARY_PATH)
slouken@386
    76
    LOCAL_CFLAGS += -DLOAD_PNG
slouken@534
    77
    LOCAL_STATIC_LIBRARIES += png
slouken@378
    78
    LOCAL_LDLIBS += -lz
slouken@378
    79
endif
slouken@378
    80
slouken@378
    81
ifeq ($(SUPPORT_WEBP),true)
slouken@386
    82
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(WEBP_LIBRARY_PATH)/src
slouken@386
    83
    LOCAL_CFLAGS += -DLOAD_WEBP
slouken@378
    84
    LOCAL_STATIC_LIBRARIES += webp
slouken@378
    85
endif
slouken@257
    86
slouken@534
    87
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)
slouken@408
    88
slouken@257
    89
include $(BUILD_SHARED_LIBRARY)