blob: 4065193d36d51d02626534bee862911af5c3b81e [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",
25 "-Wno-unused-parameter",
26 ],
27 arch: {
28 arm: {
29 srcs: [
30 "arm/arm_init.c",
31 "arm/filter_neon.S",
32 "arm/filter_neon_intrinsics.c",
33 ],
34 },
35 arm64: {
36 srcs: [
37 "arm/arm_init.c",
38 "arm/filter_neon.S",
39 "arm/filter_neon_intrinsics.c",
40 ],
41 },
42 x86: {
43 srcs: [
Leon Scroggins III3cc83ac2017-10-06 11:02:56 -040044 "intel/intel_init.c",
45 "intel/filter_sse2_intrinsics.c",
Colin Cross69201422016-10-31 15:23:08 -070046 ],
47 // Disable optimizations because they crash on windows
48 // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
49 },
50 x86_64: {
51 srcs: [
Leon Scroggins III3cc83ac2017-10-06 11:02:56 -040052 "intel/intel_init.c",
53 "intel/filter_sse2_intrinsics.c",
Colin Cross69201422016-10-31 15:23:08 -070054 ],
55 // Disable optimizations because they crash on windows
56 // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
57 },
58 },
Dan Willemsen57288742017-09-27 16:13:37 -070059 shared_libs: ["libz"],
Colin Cross69201422016-10-31 15:23:08 -070060 target: {
Colin Cross69201422016-10-31 15:23:08 -070061 android_x86: {
62 cflags: ["-DPNG_INTEL_SSE_OPT=1"],
63 },
64 android_x86_64: {
65 cflags: ["-DPNG_INTEL_SSE_OPT=1"],
66 },
Colin Cross69201422016-10-31 15:23:08 -070067 },
68 export_include_dirs: ["."],
Colin Cross69201422016-10-31 15:23:08 -070069}
70
71// For the host and device platform
72// =====================================================
73
74cc_library {
75 name: "libpng",
Vijay Venkatramanbdd08fc2017-05-17 15:33:00 -070076 vendor_available: true,
Justin Yun21693d72017-07-24 15:19:44 +090077 vndk: {
78 enabled: true,
79 },
Colin Cross69201422016-10-31 15:23:08 -070080 host_supported: true,
81 defaults: ["libpng-defaults"],
82 target: {
83 windows: {
84 enabled: true,
85 },
Colin Cross69201422016-10-31 15:23:08 -070086 },
87}
88
89// For the device (static) for NDK
90// =====================================================
91
92cc_library_static {
93 name: "libpng_ndk",
94 defaults: ["libpng-defaults"],
95 cflags: ["-ftrapv"],
96
Colin Cross69201422016-10-31 15:23:08 -070097 shared_libs: ["libz"],
98 sdk_version: "14",
99}
100
101// For testing
102// =====================================================
103
104cc_test {
Colin Cross69201422016-10-31 15:23:08 -0700105 host_supported: true,
106 gtest: false,
107 srcs: ["pngtest.c"],
108 name: "pngtest",
109 shared_libs: [
110 "libpng",
Dan Willemsen57288742017-09-27 16:13:37 -0700111 "libz",
Colin Cross69201422016-10-31 15:23:08 -0700112 ],
Colin Cross69201422016-10-31 15:23:08 -0700113}