blob: 8daf08d372a0ad1a6534147d69715e5c731b2868 [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,
Jerry Zhangb626cba2018-07-17 12:19:09 -070079 recovery_available: true,
Justin Yun21693d72017-07-24 15:19:44 +090080 vndk: {
81 enabled: true,
82 },
Jiyong Park0cbd7d62018-04-09 12:11:27 +090083 double_loadable: true,
Colin Cross69201422016-10-31 15:23:08 -070084 host_supported: true,
85 defaults: ["libpng-defaults"],
86 target: {
87 windows: {
88 enabled: true,
89 },
Colin Cross69201422016-10-31 15:23:08 -070090 },
91}
92
93// For the device (static) for NDK
94// =====================================================
95
96cc_library_static {
97 name: "libpng_ndk",
98 defaults: ["libpng-defaults"],
99 cflags: ["-ftrapv"],
100
Colin Cross69201422016-10-31 15:23:08 -0700101 shared_libs: ["libz"],
102 sdk_version: "14",
103}
104
105// For testing
106// =====================================================
107
108cc_test {
Colin Cross69201422016-10-31 15:23:08 -0700109 host_supported: true,
110 gtest: false,
111 srcs: ["pngtest.c"],
112 name: "pngtest",
Chih-Hung Hsieh76670a02017-09-28 14:42:50 -0700113 cflags: ["-Wall", "-Werror"],
Colin Cross69201422016-10-31 15:23:08 -0700114 shared_libs: [
115 "libpng",
Dan Willemsen57288742017-09-27 16:13:37 -0700116 "libz",
Colin Cross69201422016-10-31 15:23:08 -0700117 ],
Colin Cross69201422016-10-31 15:23:08 -0700118}