| OLD | NEW |
| 1 # Copyright 2014 Google Inc. | 1 # Copyright 2014 Google Inc. |
| 2 # | 2 # |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 { | 6 { |
| 7 'variables': { | 7 'variables': { |
| 8 'skia_warnings_as_errors': 0, | 8 'skia_warnings_as_errors': 0, |
| 9 }, | 9 }, |
| 10 'targets': [ | 10 'targets': [ |
| 11 { | 11 { |
| 12 'target_name': 'libpng', | 12 'target_name': 'libpng', |
| 13 'type': 'none', |
| 13 'conditions': [ | 14 'conditions': [ |
| 14 [ 'skia_libpng_static', | 15 [ 'skia_os == "android"', |
| 15 { | 16 { |
| 16 'type': 'static_library', | |
| 17 'include_dirs': [ | |
| 18 '../third_party/externals/libpng', | |
| 19 # Needed for generated pnglibconf.h | |
| 20 '../third_party/libpng', | |
| 21 ], | |
| 22 'dependencies': [ | 17 'dependencies': [ |
| 23 'zlib.gyp:zlib', | 18 'android_deps.gyp:png', |
| 24 ], | 19 ], |
| 25 'export_dependent_settings': [ | 20 'export_dependent_settings': [ |
| 26 'zlib.gyp:zlib', | 21 'android_deps.gyp:png', |
| 27 ], | 22 ], |
| 28 'direct_dependent_settings': { | 23 }, { # skia_os != "android" |
| 29 'include_dirs': [ | 24 'dependencies': [ |
| 30 '../third_party/externals/libpng', | 25 'libpng.gyp:libpng_static', |
| 31 # Needed for generated pnglibconf.h | |
| 32 '../third_party/libpng', | |
| 33 ], | |
| 34 }, | |
| 35 'cflags': [ | |
| 36 '-w', | |
| 37 '-fvisibility=hidden', | |
| 38 ], | 26 ], |
| 39 'defines': [ | 27 'export_dependent_settings': [ |
| 40 # TODO: it'd be nice to enable PNG's NEON when possible. | 28 'libpng.gyp:libpng_static', |
| 41 'PNG_ARM_NEON_OPT=0', | |
| 42 ], | 29 ], |
| 43 'sources': [ | |
| 44 '../third_party/externals/libpng/png.c', | |
| 45 '../third_party/externals/libpng/pngerror.c', | |
| 46 '../third_party/externals/libpng/pngget.c', | |
| 47 '../third_party/externals/libpng/pngmem.c', | |
| 48 '../third_party/externals/libpng/pngpread.c', | |
| 49 '../third_party/externals/libpng/pngread.c', | |
| 50 '../third_party/externals/libpng/pngrio.c', | |
| 51 '../third_party/externals/libpng/pngrtran.c', | |
| 52 '../third_party/externals/libpng/pngrutil.c', | |
| 53 '../third_party/externals/libpng/pngset.c', | |
| 54 '../third_party/externals/libpng/pngtrans.c', | |
| 55 '../third_party/externals/libpng/pngwio.c', | |
| 56 '../third_party/externals/libpng/pngwrite.c', | |
| 57 '../third_party/externals/libpng/pngwtran.c', | |
| 58 '../third_party/externals/libpng/pngwutil.c', | |
| 59 ], | |
| 60 }, { # not skia_libpng_static | |
| 61 'type': 'none', | |
| 62 'conditions': [ | |
| 63 [ 'skia_os == "android"', | |
| 64 { | |
| 65 # TODO(halcanary): merge all png targets into this file. | |
| 66 'dependencies': [ | |
| 67 'android_deps.gyp:png', | |
| 68 ], | |
| 69 'export_dependent_settings': [ | |
| 70 'android_deps.gyp:png', | |
| 71 ], | |
| 72 }, { # skia_os != "android" | |
| 73 'dependencies': [ | |
| 74 'zlib.gyp:zlib', | |
| 75 ], | |
| 76 'export_dependent_settings': [ | |
| 77 'zlib.gyp:zlib', | |
| 78 ], | |
| 79 'direct_dependent_settings': { | |
| 80 'link_settings': { | |
| 81 'libraries': [ | |
| 82 '-lpng', | |
| 83 ], | |
| 84 }, | |
| 85 }, | |
| 86 } | |
| 87 ] | |
| 88 ] | |
| 89 } | 30 } |
| 90 ] | 31 ] |
| 32 ] |
| 33 }, |
| 34 { |
| 35 'target_name': 'libpng_static', |
| 36 'type': 'static_library', |
| 37 'standalone_static_library': 1, |
| 38 'include_dirs': [ |
| 39 # Needed for generated pnglibconf.h and pngprefix.h |
| 40 '../third_party/libpng', |
| 41 '../third_party/externals/libpng', |
| 42 ], |
| 43 'dependencies': [ |
| 44 'zlib.gyp:zlib', |
| 45 ], |
| 46 'export_dependent_settings': [ |
| 47 'zlib.gyp:zlib', |
| 48 ], |
| 49 'direct_dependent_settings': { |
| 50 'include_dirs': [ |
| 51 '../third_party/externals/libpng', |
| 52 # Needed for generated pnglibconf.h and pngprefix.h |
| 53 '../third_party/libpng', |
| 54 ], |
| 55 'defines': [ |
| 56 'SKIA_PNG_PREFIXED', |
| 57 ], |
| 58 }, |
| 59 'cflags': [ |
| 60 '-w', |
| 61 '-fvisibility=hidden', |
| 62 ], |
| 63 'sources': [ |
| 64 '../third_party/externals/libpng/png.c', |
| 65 '../third_party/externals/libpng/pngerror.c', |
| 66 '../third_party/externals/libpng/pngget.c', |
| 67 '../third_party/externals/libpng/pngmem.c', |
| 68 '../third_party/externals/libpng/pngpread.c', |
| 69 '../third_party/externals/libpng/pngread.c', |
| 70 '../third_party/externals/libpng/pngrio.c', |
| 71 '../third_party/externals/libpng/pngrtran.c', |
| 72 '../third_party/externals/libpng/pngrutil.c', |
| 73 '../third_party/externals/libpng/pngset.c', |
| 74 '../third_party/externals/libpng/pngtrans.c', |
| 75 '../third_party/externals/libpng/pngwio.c', |
| 76 '../third_party/externals/libpng/pngwrite.c', |
| 77 '../third_party/externals/libpng/pngwtran.c', |
| 78 '../third_party/externals/libpng/pngwutil.c', |
| 79 ], |
| 80 'conditions': [ |
| 81 [ 'skia_os == "ios"', { |
| 82 # explicitly disable looking for NEON on iOS builds |
| 83 'defines': [ |
| 84 'PNG_ARM_NEON_OPT=0', |
| 85 ], |
| 86 }, { # skia_os != "ios" |
| 87 'dependencies': [ |
| 88 'libpng.gyp:libpng_static_neon', |
| 89 ], |
| 90 }], |
| 91 ], | 91 ], |
| 92 }, | 92 }, |
| 93 { |
| 94 'target_name': 'libpng_static_neon', |
| 95 'type': 'static_library', |
| 96 'include_dirs': [ |
| 97 # Needed for generated pnglibconf.h and pngprefix.h |
| 98 '../third_party/libpng', |
| 99 '../third_party/externals/libpng', |
| 100 ], |
| 101 'dependencies': [ |
| 102 'zlib.gyp:zlib', |
| 103 ], |
| 104 'sources': [ |
| 105 '../third_party/externals/libpng/arm/arm_init.c', |
| 106 '../third_party/externals/libpng/arm/filter_neon.S', |
| 107 '../third_party/externals/libpng/arm/filter_neon_intrinsics.c', |
| 108 ], |
| 109 'conditions': [ |
| 110 ['arm_neon_optional', { |
| 111 'cflags': [ |
| 112 '-mfpu=neon', |
| 113 ], |
| 114 }], |
| 115 ], |
| 116 } |
| 93 ] | 117 ] |
| 94 } | 118 } |
| OLD | NEW |