| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 { | 5 { |
| 6 'variables': { | 6 'targets': [ |
| 7 'conditions': [ | 7 { |
| 8 [ 'os_posix == 1 and OS != "mac" and OS != "android"', { | 8 'target_name': 'libpng', |
| 9 # Maybe link to system .so once the security concerns are thought | 9 'dependencies': [ |
| 10 # through, since we already use it due to GTK. | 10 '../zlib/zlib.gyp:zlib', |
| 11 'use_system_libpng%': 0, | 11 ], |
| 12 }, { # os_posix != 1 or OS == "mac" | 12 'defines': [ |
| 13 'use_system_libpng%': 0, | 13 'CHROME_PNG_WRITE_SUPPORT', |
| 14 }], | 14 'PNG_USER_CONFIG', |
| 15 ], | 15 ], |
| 16 }, | 16 'sources': [ |
| 17 'conditions': [ | 17 'png.c', |
| 18 ['use_system_libpng==0', { | 18 'png.h', |
| 19 'targets': [ | 19 'pngconf.h', |
| 20 { | 20 'pngerror.c', |
| 21 'target_name': 'libpng', | 21 'pnggccrd.c', |
| 22 'dependencies': [ | 22 'pngget.c', |
| 23 '../zlib/zlib.gyp:zlib', | 23 'pngmem.c', |
| 24 ], | 24 'pngpread.c', |
| 25 'pngread.c', |
| 26 'pngrio.c', |
| 27 'pngrtran.c', |
| 28 'pngrutil.c', |
| 29 'pngset.c', |
| 30 'pngtrans.c', |
| 31 'pngusr.h', |
| 32 'pngvcrd.c', |
| 33 'pngwio.c', |
| 34 'pngwrite.c', |
| 35 'pngwtran.c', |
| 36 'pngwutil.c', |
| 37 ], |
| 38 'direct_dependent_settings': { |
| 39 'include_dirs': [ |
| 40 '.', |
| 41 ], |
| 42 'defines': [ |
| 43 'CHROME_PNG_WRITE_SUPPORT', |
| 44 'PNG_USER_CONFIG', |
| 45 ], |
| 46 }, |
| 47 'export_dependent_settings': [ |
| 48 '../zlib/zlib.gyp:zlib', |
| 49 ], |
| 50 # TODO(jschuh): http://crbug.com/167187 |
| 51 'msvs_disabled_warnings': [ 4267 ], |
| 52 'conditions': [ |
| 53 ['OS!="win"', {'product_name': 'png'}], |
| 54 ['OS=="win"', { |
| 55 'type': '<(component)', |
| 56 }, { |
| 57 # Chromium libpng does not support building as a shared_library |
| 58 # on non-Windows platforms. |
| 59 'type': 'static_library', |
| 60 }], |
| 61 ['OS=="win" and component=="shared_library"', { |
| 25 'defines': [ | 62 'defines': [ |
| 26 'CHROME_PNG_WRITE_SUPPORT', | 63 'PNG_BUILD_DLL', |
| 27 'PNG_USER_CONFIG', | 64 'PNG_NO_MODULEDEF', |
| 28 ], | |
| 29 'sources': [ | |
| 30 'png.c', | |
| 31 'png.h', | |
| 32 'pngconf.h', | |
| 33 'pngerror.c', | |
| 34 'pnggccrd.c', | |
| 35 'pngget.c', | |
| 36 'pngmem.c', | |
| 37 'pngpread.c', | |
| 38 'pngread.c', | |
| 39 'pngrio.c', | |
| 40 'pngrtran.c', | |
| 41 'pngrutil.c', | |
| 42 'pngset.c', | |
| 43 'pngtrans.c', | |
| 44 'pngusr.h', | |
| 45 'pngvcrd.c', | |
| 46 'pngwio.c', | |
| 47 'pngwrite.c', | |
| 48 'pngwtran.c', | |
| 49 'pngwutil.c', | |
| 50 ], | 65 ], |
| 51 'direct_dependent_settings': { | 66 'direct_dependent_settings': { |
| 52 'include_dirs': [ | 67 'defines': [ |
| 53 '.', | 68 'PNG_USE_DLL', |
| 54 ], | 69 ], |
| 55 'defines': [ | 70 }, |
| 56 'CHROME_PNG_WRITE_SUPPORT', | 71 }], |
| 57 'PNG_USER_CONFIG', | 72 ['OS=="android"', { |
| 58 ], | 73 'toolsets': ['target', 'host'], |
| 59 }, | |
| 60 'export_dependent_settings': [ | |
| 61 '../zlib/zlib.gyp:zlib', | |
| 62 ], | |
| 63 # TODO(jschuh): http://crbug.com/167187 | |
| 64 'msvs_disabled_warnings': [ 4267 ], | |
| 65 'conditions': [ | |
| 66 ['OS!="win"', {'product_name': 'png'}], | |
| 67 ['OS=="win"', { | |
| 68 'type': '<(component)', | |
| 69 }, { | |
| 70 # Chromium libpng does not support building as a shared_library | |
| 71 # on non-Windows platforms. | |
| 72 'type': 'static_library', | |
| 73 }], | |
| 74 ['OS=="win" and component=="shared_library"', { | |
| 75 'defines': [ | |
| 76 'PNG_BUILD_DLL', | |
| 77 'PNG_NO_MODULEDEF', | |
| 78 ], | |
| 79 'direct_dependent_settings': { | |
| 80 'defines': [ | |
| 81 'PNG_USE_DLL', | |
| 82 ], | |
| 83 }, | |
| 84 }], | |
| 85 ['OS=="android"', { | |
| 86 'toolsets': ['target', 'host'], | |
| 87 }], | |
| 88 ], | |
| 89 }, | |
| 90 ] | |
| 91 }, { | |
| 92 'conditions': [ | |
| 93 ['sysroot!=""', { | |
| 94 'variables': { | |
| 95 'pkg-config': '../../build/linux/pkg-config-wrapper "<(sysroot)" "<(
target_arch)"', | |
| 96 }, | |
| 97 }, { | |
| 98 'variables': { | |
| 99 'pkg-config': 'pkg-config' | |
| 100 }, | |
| 101 }], | 74 }], |
| 102 ], | 75 ], |
| 103 'targets': [ | 76 }, |
| 104 { | 77 ] |
| 105 'target_name': 'libpng', | |
| 106 'type': 'none', | |
| 107 'dependencies': [ | |
| 108 '../zlib/zlib.gyp:zlib', | |
| 109 ], | |
| 110 'direct_dependent_settings': { | |
| 111 'cflags': [ | |
| 112 '<!@(<(pkg-config) --cflags libpng)', | |
| 113 ], | |
| 114 }, | |
| 115 'link_settings': { | |
| 116 'ldflags': [ | |
| 117 '<!@(<(pkg-config) --libs-only-L --libs-only-other libpng)', | |
| 118 ], | |
| 119 'libraries': [ | |
| 120 '<!@(<(pkg-config) --libs-only-l libpng)', | |
| 121 ], | |
| 122 }, | |
| 123 'variables': { | |
| 124 'headers_root_path': '.', | |
| 125 'header_filenames': [ | |
| 126 'png.h', | |
| 127 'pngconf.h', | |
| 128 ], | |
| 129 }, | |
| 130 'includes': [ | |
| 131 '../../build/shim_headers.gypi', | |
| 132 ], | |
| 133 }, | |
| 134 ], | |
| 135 }], | |
| 136 ], | |
| 137 } | 78 } |
| OLD | NEW |