Home | History | Annotate | Download | only in libpng
      1 # Copyright 2016 Google Inc.
      2 #
      3 # Use of this source code is governed by a BSD-style license that can be
      4 # found in the LICENSE file.
      5 
      6 declare_args() {
      7   skia_use_system_libpng = is_official_build
      8 }
      9 
     10 import("../third_party.gni")
     11 
     12 if (skia_use_system_libpng) {
     13   system("libpng") {
     14     libs = [ "png" ]
     15   }
     16 } else {
     17   third_party("libpng") {
     18     public_include_dirs = [ "." ]
     19 
     20     defines = []
     21     deps = [
     22       "//third_party/zlib",
     23     ]
     24     sources = [
     25       "png.c",
     26       "pngerror.c",
     27       "pngget.c",
     28       "pngmem.c",
     29       "pngpread.c",
     30       "pngread.c",
     31       "pngrio.c",
     32       "pngrtran.c",
     33       "pngrutil.c",
     34       "pngset.c",
     35       "pngtrans.c",
     36       "pngwio.c",
     37       "pngwrite.c",
     38       "pngwtran.c",
     39       "pngwutil.c",
     40     ]
     41 
     42     if (current_cpu == "arm" || current_cpu == "arm64") {
     43       sources += [
     44         "arm/arm_init.c",
     45         "arm/filter_neon_intrinsics.c",
     46       ]
     47     }
     48 
     49     if (current_cpu == "x86" || current_cpu == "x64") {
     50       defines += [ "PNG_INTEL_SSE" ]
     51       sources += [
     52         "contrib/intel/filter_sse2_intrinsics.c",
     53         "contrib/intel/intel_init.c",
     54       ]
     55     }
     56   }
     57 }
     58