aboutsummaryrefslogtreecommitdiff
path: root/Android.bp
blob: 72cd34066b842afb1559fc39b798961d47ed79a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// We need to build this for both the device (as a shared library)
// and the host (as a static library for tools to use).

cc_defaults {
    name: "libpng-defaults",
    exclude_srcs: [
        "example.c",
        "pngtest.c",
    ],
    srcs: ["*.c"],
    cflags: [
        "-std=gnu89",
        "-Wall",
        "-Werror",
        "-Wno-unused-parameter",
    ],
    arch: {
        arm: {
            srcs: ["arm/*"],
        },
        arm64: {
            srcs: ["arm/*",],
        },
        x86: {
            srcs: ["intel/*"],
            // Disable optimizations because they crash on windows
            // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
        },
        x86_64: {
            srcs: ["intel/*"],
            // Disable optimizations because they crash on windows
            // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
        },
    },
    shared_libs: ["libz"],
    target: {
        android_x86: {
            cflags: ["-DPNG_INTEL_SSE_OPT=1"],
        },
        android_x86_64: {
            cflags: ["-DPNG_INTEL_SSE_OPT=1"],
        },
    },
    export_include_dirs: ["."],
}

// For the host and device platform
// =====================================================

cc_library {
    name: "libpng",
    vendor_available: true,
    // TODO(b/153609531): remove when no longer needed.
    native_bridge_supported: true,
    recovery_available: true,
    vndk: {
        enabled: true,
    },
    double_loadable: true,
    host_supported: true,
    defaults: ["libpng-defaults"],
    target: {
        windows: {
            enabled: true,
        },
    },
}

// For the device (static) for NDK
// =====================================================

cc_library_static {
    name: "libpng_ndk",
    defaults: ["libpng-defaults"],
    cflags: ["-ftrapv"],

    shared_libs: ["libz"],
    sdk_version: "14",
}

// For testing
// =====================================================

cc_test {
    host_supported: true,
    gtest: false,
    srcs: ["pngtest.c"],
    name: "pngtest",
    cflags: ["-Wall", "-Werror"],
    shared_libs: [
        "libpng",
        "libz",
    ],
}