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", |
Haibo Huang | 4f55151 | 2019-06-10 11:41:54 -0700 | [diff] [blame] | 6 | exclude_srcs: [ |
| 7 | "example.c", |
| 8 | "pngtest.c", |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 9 | ], |
Haibo Huang | 4f55151 | 2019-06-10 11:41:54 -0700 | [diff] [blame] | 10 | srcs: ["*.c"], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 11 | cflags: [ |
| 12 | "-std=gnu89", |
Chih-Hung Hsieh | 76670a0 | 2017-09-28 14:42:50 -0700 | [diff] [blame] | 13 | "-Wall", |
| 14 | "-Werror", |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 15 | "-Wno-unused-parameter", |
| 16 | ], |
| 17 | arch: { |
| 18 | arm: { |
Haibo Huang | 4f55151 | 2019-06-10 11:41:54 -0700 | [diff] [blame] | 19 | srcs: ["arm/*"], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 20 | }, |
| 21 | arm64: { |
Haibo Huang | 4f55151 | 2019-06-10 11:41:54 -0700 | [diff] [blame] | 22 | srcs: ["arm/*",], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 23 | }, |
| 24 | x86: { |
Haibo Huang | 4f55151 | 2019-06-10 11:41:54 -0700 | [diff] [blame] | 25 | srcs: ["intel/*"], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 26 | // Disable optimizations because they crash on windows |
| 27 | // cflags: ["-DPNG_INTEL_SSE_OPT=1"], |
| 28 | }, |
| 29 | x86_64: { |
Haibo Huang | 4f55151 | 2019-06-10 11:41:54 -0700 | [diff] [blame] | 30 | srcs: ["intel/*"], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 31 | // Disable optimizations because they crash on windows |
| 32 | // cflags: ["-DPNG_INTEL_SSE_OPT=1"], |
| 33 | }, |
| 34 | }, |
Dan Willemsen | 5728874 | 2017-09-27 16:13:37 -0700 | [diff] [blame] | 35 | shared_libs: ["libz"], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 36 | target: { |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 37 | android_x86: { |
| 38 | cflags: ["-DPNG_INTEL_SSE_OPT=1"], |
| 39 | }, |
| 40 | android_x86_64: { |
| 41 | cflags: ["-DPNG_INTEL_SSE_OPT=1"], |
| 42 | }, |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 43 | }, |
| 44 | export_include_dirs: ["."], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | // For the host and device platform |
| 48 | // ===================================================== |
| 49 | |
| 50 | cc_library { |
| 51 | name: "libpng", |
Vijay Venkatraman | bdd08fc | 2017-05-17 15:33:00 -0700 | [diff] [blame] | 52 | vendor_available: true, |
Victor Khimenko | dff687c | 2020-06-11 03:05:36 +0200 | [diff] [blame] | 53 | // TODO(b/153609531): remove when no longer needed. |
| 54 | native_bridge_supported: true, |
Jerry Zhang | b626cba | 2018-07-17 12:19:09 -0700 | [diff] [blame] | 55 | recovery_available: true, |
Justin Yun | 21693d7 | 2017-07-24 15:19:44 +0900 | [diff] [blame] | 56 | vndk: { |
| 57 | enabled: true, |
| 58 | }, |
Jiyong Park | 0cbd7d6 | 2018-04-09 12:11:27 +0900 | [diff] [blame] | 59 | double_loadable: true, |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 60 | host_supported: true, |
| 61 | defaults: ["libpng-defaults"], |
| 62 | target: { |
| 63 | windows: { |
| 64 | enabled: true, |
| 65 | }, |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 66 | }, |
| 67 | } |
| 68 | |
| 69 | // For the device (static) for NDK |
| 70 | // ===================================================== |
| 71 | |
| 72 | cc_library_static { |
| 73 | name: "libpng_ndk", |
| 74 | defaults: ["libpng-defaults"], |
| 75 | cflags: ["-ftrapv"], |
| 76 | |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 77 | shared_libs: ["libz"], |
| 78 | sdk_version: "14", |
| 79 | } |
| 80 | |
| 81 | // For testing |
| 82 | // ===================================================== |
| 83 | |
| 84 | cc_test { |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 85 | host_supported: true, |
| 86 | gtest: false, |
| 87 | srcs: ["pngtest.c"], |
| 88 | name: "pngtest", |
Chih-Hung Hsieh | 76670a0 | 2017-09-28 14:42:50 -0700 | [diff] [blame] | 89 | cflags: ["-Wall", "-Werror"], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 90 | shared_libs: [ |
| 91 | "libpng", |
Dan Willemsen | 5728874 | 2017-09-27 16:13:37 -0700 | [diff] [blame] | 92 | "libz", |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 93 | ], |
Colin Cross | 6920142 | 2016-10-31 15:23:08 -0700 | [diff] [blame] | 94 | } |