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