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 | 6 |
7 config("libpng_config") { | 7 config("libpng_config") { |
8 include_dirs = [ "." ] | 8 include_dirs = [ "." ] |
9 | 9 |
10 defines = [] | 10 defines = [] |
11 | 11 |
12 if (is_win) { | 12 if (is_win) { |
13 if (is_component_build) { | 13 if (is_component_build) { |
14 defines += [ | 14 defines += [ |
15 "PNG_USE_DLL", | 15 "PNG_USE_DLL", |
16 "PNG_NO_MODULEDEF", | 16 "PNG_NO_MODULEDEF", |
17 ] | 17 ] |
18 } | 18 } |
19 } | 19 } |
20 } | 20 } |
21 | 21 |
22 # Must be in a config because of how GN orders flags (otherwise -Wall will | 22 # Must be in a config because of how GN orders flags (otherwise -Wall will |
23 # appear after this, and turn it back on). | 23 # appear after this, and turn it back on). |
24 config("clang_warnings") { | 24 config("clang_warnings") { |
25 if (is_clang) { | 25 if (is_clang) { |
26 # Upstream uses self-assignment to avoid warnings. | |
27 cflags = [ | 26 cflags = [ |
28 # libpng checks that the width is not greater than PNG_SIZE_MAX. | 27 # 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 | 28 # On platforms where size_t is 64-bits, this comparison will always |
30 # be false. | 29 # be false. |
31 "-Wno-tautological-constant-out-of-range-compare", | 30 "-Wno-tautological-constant-out-of-range-compare", |
32 ] | 31 ] |
33 } | 32 } |
34 } | 33 } |
35 | 34 |
36 source_set("libpng_sources") { | 35 source_set("libpng_sources") { |
(...skipping 16 matching lines...) Expand all Loading... |
53 "pngset.c", | 52 "pngset.c", |
54 "pngstruct.h", | 53 "pngstruct.h", |
55 "pngtrans.c", | 54 "pngtrans.c", |
56 "pngwio.c", | 55 "pngwio.c", |
57 "pngwrite.c", | 56 "pngwrite.c", |
58 "pngwtran.c", | 57 "pngwtran.c", |
59 "pngwutil.c", | 58 "pngwutil.c", |
60 ] | 59 ] |
61 | 60 |
62 defines = [] | 61 defines = [] |
| 62 cflags = [] |
63 | 63 |
64 if (current_cpu == "x86" || current_cpu == "x64") { | 64 if (current_cpu == "x86" || current_cpu == "x64") { |
65 sources += [ | 65 sources += [ |
66 "contrib/intel/filter_sse2_intrinsics.c", | 66 "contrib/intel/filter_sse2_intrinsics.c", |
67 "contrib/intel/intel_init.c", | 67 "contrib/intel/intel_init.c", |
68 ] | 68 ] |
69 defines += [ "PNG_INTEL_SSE_OPT=1" ] | 69 defines += [ "PNG_INTEL_SSE_OPT=1" ] |
70 } else if (current_cpu == "arm" || current_cpu == "arm64") { | 70 } else if (current_cpu == "arm" || current_cpu == "arm64") { |
71 sources += [ | 71 sources += [ |
72 "arm/arm_init.c", | 72 "arm/arm_init.c", |
73 "arm/filter_neon_intrinsics.c", | 73 "arm/filter_neon_intrinsics.c", |
74 ] | 74 ] |
75 defines += [ | 75 defines += [ |
76 "PNG_ARM_NEON_OPT=2", | 76 "PNG_ARM_NEON_OPT=2", |
77 "PNG_ARM_NEON_IMPLEMENTATION=1", | 77 "PNG_ARM_NEON_IMPLEMENTATION=1", |
78 ] | 78 ] |
79 } | 79 } |
80 | 80 |
81 configs -= [ "//build/config/compiler:chromium_code" ] | 81 configs -= [ "//build/config/compiler:chromium_code" ] |
82 configs += [ "//build/config/compiler:no_chromium_code" ] | 82 configs += [ "//build/config/compiler:no_chromium_code" ] |
83 | 83 |
| 84 if (is_win) { |
| 85 # Unary minus applied to unsigned type. |
| 86 cflags += [ "/wd4146" ] |
| 87 } |
| 88 |
84 if (is_win && is_component_build) { | 89 if (is_win && is_component_build) { |
85 defines += [ "PNG_BUILD_DLL" ] | 90 defines += [ "PNG_BUILD_DLL" ] |
86 } | 91 } |
87 | 92 |
88 public_configs = [ ":libpng_config" ] | 93 public_configs = [ ":libpng_config" ] |
89 | 94 |
90 public_deps = [ | 95 public_deps = [ |
91 "//third_party/zlib", | 96 "//third_party/zlib", |
92 ] | 97 ] |
93 | 98 |
94 configs += [ ":clang_warnings" ] | 99 configs += [ ":clang_warnings" ] |
95 } | 100 } |
96 | 101 |
97 if (is_win) { | 102 if (is_win) { |
98 component("libpng") { | 103 component("libpng") { |
99 public_deps = [ | 104 public_deps = [ |
100 ":libpng_sources", | 105 ":libpng_sources", |
101 ] | 106 ] |
102 } | 107 } |
103 } else { | 108 } else { |
104 group("libpng") { | 109 group("libpng") { |
105 public_deps = [ | 110 public_deps = [ |
106 ":libpng_sources", | 111 ":libpng_sources", |
107 ] | 112 ] |
108 } | 113 } |
109 } | 114 } |
OLD | NEW |