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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
| // 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",
| srcs: [
| "png.c",
| "pngerror.c",
| "pngget.c",
| "pngmem.c",
| "pngpread.c",
| "pngread.c",
| "pngrio.c",
| "pngrtran.c",
| "pngrutil.c",
| "pngset.c",
| "pngtrans.c",
| "pngwio.c",
| "pngwrite.c",
| "pngwtran.c",
| "pngwutil.c",
| ],
| cflags: [
| "-std=gnu89",
| "-Wall",
| "-Werror",
| "-Wno-unused-parameter",
| ],
| arch: {
| arm: {
| srcs: [
| "arm/arm_init.c",
| "arm/filter_neon.S",
| "arm/filter_neon_intrinsics.c",
| ],
| },
| arm64: {
| srcs: [
| "arm/arm_init.c",
| "arm/filter_neon.S",
| "arm/filter_neon_intrinsics.c",
| ],
| },
| x86: {
| srcs: [
| "intel/intel_init.c",
| "intel/filter_sse2_intrinsics.c",
| ],
| // Disable optimizations because they crash on windows
| // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
| },
| x86_64: {
| srcs: [
| "intel/intel_init.c",
| "intel/filter_sse2_intrinsics.c",
| ],
| // 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,
| 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",
| ],
| }
|
|