Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 1 | // 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 | |
| 4 | cc_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 Hsieh | 76670a0 | 2017-09-28 14:42:50 -0700 | [diff] [blame] | 25 | "-Wall", |
| 26 | "-Werror", |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 27 | "-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", |
xNombre | d07bb0d | 2020-03-10 20:17:12 +0100 | [diff] [blame] | 35 | "arm/palette_neon_intrinsics.c", |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 36 | ], |
Jonathan Wright | e8aa59e | 2020-07-04 20:51:07 +0200 | [diff] [blame] | 37 | cflags: ["-O3"], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 38 | }, |
| 39 | arm64: { |
| 40 | srcs: [ |
| 41 | "arm/arm_init.c", |
| 42 | "arm/filter_neon.S", |
| 43 | "arm/filter_neon_intrinsics.c", |
xNombre | d07bb0d | 2020-03-10 20:17:12 +0100 | [diff] [blame] | 44 | "arm/palette_neon_intrinsics.c", |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 45 | ], |
Jonathan Wright | e8aa59e | 2020-07-04 20:51:07 +0200 | [diff] [blame] | 46 | cflags: ["-O3"], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 47 | }, |
| 48 | x86: { |
| 49 | srcs: [ |
Leon Scroggins III | 3cc83ac | 2017-10-06 11:02:56 -0400 | [diff] [blame] | 50 | "intel/intel_init.c", |
| 51 | "intel/filter_sse2_intrinsics.c", |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 52 | ], |
| 53 | // Disable optimizations because they crash on windows |
| 54 | // cflags: ["-DPNG_INTEL_SSE_OPT=1"], |
| 55 | }, |
| 56 | x86_64: { |
| 57 | srcs: [ |
Leon Scroggins III | 3cc83ac | 2017-10-06 11:02:56 -0400 | [diff] [blame] | 58 | "intel/intel_init.c", |
| 59 | "intel/filter_sse2_intrinsics.c", |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 60 | ], |
| 61 | // Disable optimizations because they crash on windows |
| 62 | // cflags: ["-DPNG_INTEL_SSE_OPT=1"], |
| 63 | }, |
| 64 | }, |
Dan Willemsen | 5728874 | 2017-09-27 16:13:37 -0700 | [diff] [blame] | 65 | shared_libs: ["libz"], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 66 | target: { |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 67 | android_x86: { |
| 68 | cflags: ["-DPNG_INTEL_SSE_OPT=1"], |
| 69 | }, |
| 70 | android_x86_64: { |
| 71 | cflags: ["-DPNG_INTEL_SSE_OPT=1"], |
| 72 | }, |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 73 | }, |
| 74 | export_include_dirs: ["."], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | // For the host and device platform |
| 78 | // ===================================================== |
| 79 | |
| 80 | cc_library { |
| 81 | name: "libpng", |
Vijay Venkatraman | bdd08fc | 2017-05-17 15:33:00 -0700 | [diff] [blame] | 82 | vendor_available: true, |
Jerry Zhang | b626cba | 2018-07-17 12:19:09 -0700 | [diff] [blame] | 83 | recovery_available: true, |
Justin Yun | 21693d7 | 2017-07-24 15:19:44 +0900 | [diff] [blame] | 84 | vndk: { |
| 85 | enabled: true, |
| 86 | }, |
Jiyong Park | 0cbd7d6 | 2018-04-09 12:11:27 +0900 | [diff] [blame] | 87 | double_loadable: true, |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 88 | host_supported: true, |
| 89 | defaults: ["libpng-defaults"], |
| 90 | target: { |
| 91 | windows: { |
| 92 | enabled: true, |
| 93 | }, |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 94 | }, |
| 95 | } |
| 96 | |
| 97 | // For the device (static) for NDK |
| 98 | // ===================================================== |
| 99 | |
| 100 | cc_library_static { |
| 101 | name: "libpng_ndk", |
| 102 | defaults: ["libpng-defaults"], |
| 103 | cflags: ["-ftrapv"], |
| 104 | |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 105 | shared_libs: ["libz"], |
| 106 | sdk_version: "14", |
| 107 | } |
| 108 | |
| 109 | // For testing |
| 110 | // ===================================================== |
| 111 | |
| 112 | cc_test { |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 113 | host_supported: true, |
| 114 | gtest: false, |
| 115 | srcs: ["pngtest.c"], |
| 116 | name: "pngtest", |
Chih-Hung Hsieh | 76670a0 | 2017-09-28 14:42:50 -0700 | [diff] [blame] | 117 | cflags: ["-Wall", "-Werror"], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 118 | shared_libs: [ |
| 119 | "libpng", |
Dan Willemsen | 5728874 | 2017-09-27 16:13:37 -0700 | [diff] [blame] | 120 | "libz", |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 121 | ], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 122 | } |