blob: d5649c557bd48db27ef023cc50031e6254546a22 [file] [log] [blame]
Colin Cross69201422016-10-31 15:23:08 -07001// We need to build this for both the device (as a shared library)
2// and the host (as a static library for tools to use).
3
4cc_defaults {
5 name: "libpng-defaults",
6 srcs: [
7 "png.c",
8 "pngerror.c",
9 "pngget.c",
10 "pngmem.c",
11 "pngpread.c",
12 "pngread.c",
13 "pngrio.c",
14 "pngrtran.c",
15 "pngrutil.c",
16 "pngset.c",
17 "pngtrans.c",
18 "pngwio.c",
19 "pngwrite.c",
20 "pngwtran.c",
21 "pngwutil.c",
22 ],
23 cflags: [
24 "-std=gnu89",
Chih-Hung Hsieh76670a02017-09-28 14:42:50 -070025 "-Wall",
26 "-Werror",
Colin Cross69201422016-10-31 15:23:08 -070027 "-Wno-unused-parameter",
28 ],
29 arch: {
30 arm: {
31 srcs: [
32 "arm/arm_init.c",
33 "arm/filter_neon.S",
34 "arm/filter_neon_intrinsics.c",
35 ],
36 },
37 arm64: {
38 srcs: [
39 "arm/arm_init.c",
40 "arm/filter_neon.S",
41 "arm/filter_neon_intrinsics.c",
42 ],
43 },
44 x86: {
45 srcs: [
46 "contrib/intel/intel_init.c",
47 "contrib/intel/filter_sse2_intrinsics.c",
48 ],
49 // Disable optimizations because they crash on windows
50 // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
51 },
52 x86_64: {
53 srcs: [
54 "contrib/intel/intel_init.c",
55 "contrib/intel/filter_sse2_intrinsics.c",
56 ],
57 // Disable optimizations because they crash on windows
58 // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
59 },
60 },
61 target: {
62 android: {
63 shared_libs: ["libz"],
64 },
65 android_x86: {
66 cflags: ["-DPNG_INTEL_SSE_OPT=1"],
67 },
68 android_x86_64: {
69 cflags: ["-DPNG_INTEL_SSE_OPT=1"],
70 },
71 host: {
72 shared_libs: ["libz-host"],
73 },
74 },
75 export_include_dirs: ["."],
Colin Cross69201422016-10-31 15:23:08 -070076}
77
78// For the host and device platform
79// =====================================================
80
81cc_library {
82 name: "libpng",
Vijay Venkatramanbdd08fc2017-05-17 15:33:00 -070083 vendor_available: true,
Justin Yun21693d72017-07-24 15:19:44 +090084 vndk: {
85 enabled: true,
86 },
Colin Cross69201422016-10-31 15:23:08 -070087 host_supported: true,
88 defaults: ["libpng-defaults"],
89 target: {
90 windows: {
91 enabled: true,
92 },
Colin Cross69201422016-10-31 15:23:08 -070093 },
94}
95
96// For the device (static) for NDK
97// =====================================================
98
99cc_library_static {
100 name: "libpng_ndk",
101 defaults: ["libpng-defaults"],
102 cflags: ["-ftrapv"],
103
Colin Cross69201422016-10-31 15:23:08 -0700104 shared_libs: ["libz"],
105 sdk_version: "14",
106}
107
108// For testing
109// =====================================================
110
111cc_test {
Colin Cross69201422016-10-31 15:23:08 -0700112 host_supported: true,
113 gtest: false,
114 srcs: ["pngtest.c"],
115 name: "pngtest",
Chih-Hung Hsieh76670a02017-09-28 14:42:50 -0700116 cflags: ["-Wall", "-Werror"],
Colin Cross69201422016-10-31 15:23:08 -0700117 shared_libs: [
118 "libpng",
119 ],
120 target: {
121 android: {
122 shared_libs: ["libz"],
123 },
124 host: {
125 shared_libs: ["libz-host"],
126 },
127 },
128}