blob: 72cd34066b842afb1559fc39b798961d47ed79a6 [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",
Haibo Huang4f551512019-06-10 11:41:54 -07006 exclude_srcs: [
7 "example.c",
8 "pngtest.c",
Colin Cross69201422016-10-31 15:23:08 -07009 ],
Haibo Huang4f551512019-06-10 11:41:54 -070010 srcs: ["*.c"],
Colin Cross69201422016-10-31 15:23:08 -070011 cflags: [
12 "-std=gnu89",
Chih-Hung Hsieh76670a02017-09-28 14:42:50 -070013 "-Wall",
14 "-Werror",
Colin Cross69201422016-10-31 15:23:08 -070015 "-Wno-unused-parameter",
16 ],
17 arch: {
18 arm: {
Haibo Huang4f551512019-06-10 11:41:54 -070019 srcs: ["arm/*"],
Colin Cross69201422016-10-31 15:23:08 -070020 },
21 arm64: {
Haibo Huang4f551512019-06-10 11:41:54 -070022 srcs: ["arm/*",],
Colin Cross69201422016-10-31 15:23:08 -070023 },
24 x86: {
Haibo Huang4f551512019-06-10 11:41:54 -070025 srcs: ["intel/*"],
Colin Cross69201422016-10-31 15:23:08 -070026 // Disable optimizations because they crash on windows
27 // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
28 },
29 x86_64: {
Haibo Huang4f551512019-06-10 11:41:54 -070030 srcs: ["intel/*"],
Colin Cross69201422016-10-31 15:23:08 -070031 // Disable optimizations because they crash on windows
32 // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
33 },
34 },
Dan Willemsen57288742017-09-27 16:13:37 -070035 shared_libs: ["libz"],
Colin Cross69201422016-10-31 15:23:08 -070036 target: {
Colin Cross69201422016-10-31 15:23:08 -070037 android_x86: {
38 cflags: ["-DPNG_INTEL_SSE_OPT=1"],
39 },
40 android_x86_64: {
41 cflags: ["-DPNG_INTEL_SSE_OPT=1"],
42 },
Colin Cross69201422016-10-31 15:23:08 -070043 },
44 export_include_dirs: ["."],
Colin Cross69201422016-10-31 15:23:08 -070045}
46
47// For the host and device platform
48// =====================================================
49
50cc_library {
51 name: "libpng",
Vijay Venkatramanbdd08fc2017-05-17 15:33:00 -070052 vendor_available: true,
Victor Khimenkodff687c2020-06-11 03:05:36 +020053 // TODO(b/153609531): remove when no longer needed.
54 native_bridge_supported: true,
Jerry Zhangb626cba2018-07-17 12:19:09 -070055 recovery_available: true,
Justin Yun21693d72017-07-24 15:19:44 +090056 vndk: {
57 enabled: true,
58 },
Jiyong Park0cbd7d62018-04-09 12:11:27 +090059 double_loadable: true,
Colin Cross69201422016-10-31 15:23:08 -070060 host_supported: true,
61 defaults: ["libpng-defaults"],
62 target: {
63 windows: {
64 enabled: true,
65 },
Colin Cross69201422016-10-31 15:23:08 -070066 },
67}
68
69// For the device (static) for NDK
70// =====================================================
71
72cc_library_static {
73 name: "libpng_ndk",
74 defaults: ["libpng-defaults"],
75 cflags: ["-ftrapv"],
76
Colin Cross69201422016-10-31 15:23:08 -070077 shared_libs: ["libz"],
78 sdk_version: "14",
79}
80
81// For testing
82// =====================================================
83
84cc_test {
Colin Cross69201422016-10-31 15:23:08 -070085 host_supported: true,
86 gtest: false,
87 srcs: ["pngtest.c"],
88 name: "pngtest",
Chih-Hung Hsieh76670a02017-09-28 14:42:50 -070089 cflags: ["-Wall", "-Werror"],
Colin Cross69201422016-10-31 15:23:08 -070090 shared_libs: [
91 "libpng",
Dan Willemsen57288742017-09-27 16:13:37 -070092 "libz",
Colin Cross69201422016-10-31 15:23:08 -070093 ],
Colin Cross69201422016-10-31 15:23:08 -070094}