blob: 3742470207fcb3d3dccd421caa14ae4eff8dcc7e [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: [
Leon Scroggins III3cc83ac2017-10-06 11:02:56 -040046 "intel/intel_init.c",
47 "intel/filter_sse2_intrinsics.c",
Colin Cross69201422016-10-31 15:23:08 -070048 ],
49 // Disable optimizations because they crash on windows
50 // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
51 },
52 x86_64: {
53 srcs: [
Leon Scroggins III3cc83ac2017-10-06 11:02:56 -040054 "intel/intel_init.c",
55 "intel/filter_sse2_intrinsics.c",
Colin Cross69201422016-10-31 15:23:08 -070056 ],
57 // Disable optimizations because they crash on windows
58 // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
59 },
60 },
Dan Willemsen57288742017-09-27 16:13:37 -070061 shared_libs: ["libz"],
Colin Cross69201422016-10-31 15:23:08 -070062 target: {
Colin Cross69201422016-10-31 15:23:08 -070063 android_x86: {
64 cflags: ["-DPNG_INTEL_SSE_OPT=1"],
65 },
66 android_x86_64: {
67 cflags: ["-DPNG_INTEL_SSE_OPT=1"],
68 },
Colin Cross69201422016-10-31 15:23:08 -070069 },
70 export_include_dirs: ["."],
Colin Cross69201422016-10-31 15:23:08 -070071}
72
73// For the host and device platform
74// =====================================================
75
76cc_library {
77 name: "libpng",
Vijay Venkatramanbdd08fc2017-05-17 15:33:00 -070078 vendor_available: true,
Justin Yun21693d72017-07-24 15:19:44 +090079 vndk: {
80 enabled: true,
81 },
Jiyong Park0cbd7d62018-04-09 12:11:27 +090082 double_loadable: true,
Colin Cross69201422016-10-31 15:23:08 -070083 host_supported: true,
84 defaults: ["libpng-defaults"],
85 target: {
86 windows: {
87 enabled: true,
88 },
Colin Cross69201422016-10-31 15:23:08 -070089 },
90}
91
92// For the device (static) for NDK
93// =====================================================
94
95cc_library_static {
96 name: "libpng_ndk",
97 defaults: ["libpng-defaults"],
98 cflags: ["-ftrapv"],
99
Colin Cross69201422016-10-31 15:23:08 -0700100 shared_libs: ["libz"],
101 sdk_version: "14",
102}
103
104// For testing
105// =====================================================
106
107cc_test {
Colin Cross69201422016-10-31 15:23:08 -0700108 host_supported: true,
109 gtest: false,
110 srcs: ["pngtest.c"],
111 name: "pngtest",
Chih-Hung Hsieh76670a02017-09-28 14:42:50 -0700112 cflags: ["-Wall", "-Werror"],
Colin Cross69201422016-10-31 15:23:08 -0700113 shared_libs: [
114 "libpng",
Dan Willemsen57288742017-09-27 16:13:37 -0700115 "libz",
Colin Cross69201422016-10-31 15:23:08 -0700116 ],
Colin Cross69201422016-10-31 15:23:08 -0700117}