Home | History | Annotate | Download | only in libpng
      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",
     25         "-Wall",
     26         "-Werror",
     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: [
     46                 "intel/intel_init.c",
     47                 "intel/filter_sse2_intrinsics.c",
     48             ],
     49             // Disable optimizations because they crash on windows
     50             // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
     51         },
     52         x86_64: {
     53             srcs: [
     54                 "intel/intel_init.c",
     55                 "intel/filter_sse2_intrinsics.c",
     56             ],
     57             // Disable optimizations because they crash on windows
     58             // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
     59         },
     60     },
     61     shared_libs: ["libz"],
     62     target: {
     63         android_x86: {
     64             cflags: ["-DPNG_INTEL_SSE_OPT=1"],
     65         },
     66         android_x86_64: {
     67             cflags: ["-DPNG_INTEL_SSE_OPT=1"],
     68         },
     69     },
     70     export_include_dirs: ["."],
     71 }
     72 
     73 // For the host and device platform
     74 // =====================================================
     75 
     76 cc_library {
     77     name: "libpng",
     78     vendor_available: true,
     79     vndk: {
     80         enabled: true,
     81     },
     82     host_supported: true,
     83     defaults: ["libpng-defaults"],
     84     target: {
     85         windows: {
     86             enabled: true,
     87         },
     88     },
     89 }
     90 
     91 // For the device (static) for NDK
     92 // =====================================================
     93 
     94 cc_library_static {
     95     name: "libpng_ndk",
     96     defaults: ["libpng-defaults"],
     97     cflags: ["-ftrapv"],
     98 
     99     shared_libs: ["libz"],
    100     sdk_version: "14",
    101 }
    102 
    103 // For testing
    104 // =====================================================
    105 
    106 cc_test {
    107     host_supported: true,
    108     gtest: false,
    109     srcs: ["pngtest.c"],
    110     name: "pngtest",
    111     cflags: ["-Wall", "-Werror"],
    112     shared_libs: [
    113         "libpng",
    114         "libz",
    115     ],
    116 }
    117