Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//build/config/chromecast_build.gni") | 5 import("//build/config/chromecast_build.gni") |
| 6 import("//build/config/arm.gni") | 6 import("//build/config/arm.gni") |
| 7 | 7 |
| 8 config("libpng_config") { | 8 config("libpng_config") { |
| 9 include_dirs = [ "." ] | 9 include_dirs = [ "." ] |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 if (is_clang) { | 26 if (is_clang) { |
| 27 cflags = [ | 27 cflags = [ |
| 28 # libpng checks that the width is not greater than PNG_SIZE_MAX. | 28 # libpng checks that the width is not greater than PNG_SIZE_MAX. |
| 29 # On platforms where size_t is 64-bits, this comparison will always | 29 # On platforms where size_t is 64-bits, this comparison will always |
| 30 # be false. | 30 # be false. |
| 31 "-Wno-tautological-constant-out-of-range-compare", | 31 "-Wno-tautological-constant-out-of-range-compare", |
| 32 ] | 32 ] |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 | 35 |
| 36 # Must be in a config because of how GN orders flags (otherwise the default | |
| 37 # flags will appear after this and turn these back off). This is a fix for | |
| 38 # png encoding performance regressions (crbug.com/619850). | |
| 39 config("android_gcc_optimizations") { | |
| 40 if (is_android && !is_clang) { | |
| 41 cflags = [ | |
| 42 "-O2", | |
| 43 "-finline-functions", | |
| 44 ] | |
| 45 } | |
| 46 } | |
| 47 | |
| 48 # Must be in a config because of how GN orders flags (otherwise the default | |
| 49 # flags will appear after this and turn these back off). This is a fix for | |
| 50 # png encoding performance regressions (crbug.com/619850). | |
| 51 config("msvs_optimizations") { | |
| 52 if (is_win && !is_clang) { | |
|
Nico
2016/07/01 14:12:33
why `!is_clang`?
msarett
2016/07/01 14:44:33
Possibly this is unnecessary... I'll remove if yo
| |
| 53 cflags = [ | |
| 54 "/O2", | |
| 55 ] | |
| 56 } | |
| 57 } | |
| 58 | |
| 36 source_set("libpng_sources") { | 59 source_set("libpng_sources") { |
| 37 sources = [ | 60 sources = [ |
| 38 "png.c", | 61 "png.c", |
| 39 "png.h", | 62 "png.h", |
| 40 "pngconf.h", | 63 "pngconf.h", |
| 41 "pngerror.c", | 64 "pngerror.c", |
| 42 "pngget.c", | 65 "pngget.c", |
| 43 "pnginfo.h", | 66 "pnginfo.h", |
| 44 "pnglibconf.h", | 67 "pnglibconf.h", |
| 45 "pngmem.c", | 68 "pngmem.c", |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 defines += [ "PNG_BUILD_DLL" ] | 114 defines += [ "PNG_BUILD_DLL" ] |
| 92 } | 115 } |
| 93 | 116 |
| 94 public_configs = [ ":libpng_config" ] | 117 public_configs = [ ":libpng_config" ] |
| 95 | 118 |
| 96 public_deps = [ | 119 public_deps = [ |
| 97 "//third_party/zlib", | 120 "//third_party/zlib", |
| 98 ] | 121 ] |
| 99 | 122 |
| 100 configs += [ ":clang_warnings" ] | 123 configs += [ ":clang_warnings" ] |
| 124 configs += [ ":android_gcc_optimizations" ] | |
| 125 configs += [ ":msvs_optimizations" ] | |
| 101 } | 126 } |
| 102 | 127 |
| 103 if (is_win) { | 128 if (is_win) { |
| 104 component("libpng") { | 129 component("libpng") { |
| 105 public_deps = [ | 130 public_deps = [ |
| 106 ":libpng_sources", | 131 ":libpng_sources", |
| 107 ] | 132 ] |
| 108 } | 133 } |
| 109 } else { | 134 } else { |
| 110 group("libpng") { | 135 group("libpng") { |
| 111 public_deps = [ | 136 public_deps = [ |
| 112 ":libpng_sources", | 137 ":libpng_sources", |
| 113 ] | 138 ] |
| 114 } | 139 } |
| 115 } | 140 } |
| OLD | NEW |