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 config("libpng_config") { | 5 config("libpng_config") { |
6 include_dirs = [ "." ] | 6 include_dirs = [ "." ] |
7 | 7 |
8 defines = [ | 8 defines = [ |
9 "CHROME_PNG_WRITE_SUPPORT", | 9 "CHROME_PNG_WRITE_SUPPORT", |
10 "PNG_USER_CONFIG", | 10 "PNG_USER_CONFIG", |
11 ] | 11 ] |
12 | 12 |
13 if (is_android) { | 13 if (is_android) { |
14 #'toolsets': ['target', 'host'], | 14 #'toolsets': ['target', 'host'], |
15 defines += [ "CHROME_PNG_READ_PACK_SUPPORT" ] # Required by freetype. | 15 defines += [ "CHROME_PNG_READ_PACK_SUPPORT" ] # Required by freetype. |
16 } | 16 } |
17 | 17 |
18 if (is_win) { | 18 if (is_win) { |
19 if (is_component_build) { | 19 if (is_component_build) { |
20 defines += [ | 20 defines += [ |
21 "PNG_USE_DLL", | 21 "PNG_USE_DLL", |
22 "PNG_NO_MODULEDEF", | 22 "PNG_NO_MODULEDEF", |
23 ] | 23 ] |
24 } | 24 } |
25 } | 25 } |
26 } | 26 } |
27 | 27 |
28 # Must be in a config because of how GN orders flags (otherwise -Wall will | |
29 # appear after this, and turn it back on). | |
30 config("clang_warnings") { | |
31 if (is_clang) { | |
32 # Upstream uses self-assignment to avoid warnings. | |
33 cflags = [ "-Wno-self-assign" ] | |
34 } | |
35 } | |
36 | |
37 source_set("libpng_sources") { | 28 source_set("libpng_sources") { |
38 sources = [ | 29 sources = [ |
39 "png.c", | 30 "png.c", |
40 "png.h", | 31 "png.h", |
41 "pngconf.h", | 32 "pngconf.h", |
42 "pngerror.c", | 33 "pngerror.c", |
43 "pnggccrd.c", | 34 "pnggccrd.c", |
44 "pngget.c", | 35 "pngget.c", |
45 "pngmem.c", | 36 "pngmem.c", |
46 "pngpread.c", | 37 "pngpread.c", |
(...skipping 17 matching lines...) Expand all Loading... |
64 if (is_win && is_component_build) { | 55 if (is_win && is_component_build) { |
65 defines = [ "PNG_BUILD_DLL" ] | 56 defines = [ "PNG_BUILD_DLL" ] |
66 } | 57 } |
67 | 58 |
68 public_configs = [ ":libpng_config" ] | 59 public_configs = [ ":libpng_config" ] |
69 | 60 |
70 public_deps = [ | 61 public_deps = [ |
71 "//third_party/zlib", | 62 "//third_party/zlib", |
72 ] | 63 ] |
73 | 64 |
| 65 # Must be in a config because of how GN orders flags (otherwise -Wall will |
| 66 # appear after this, and turn it back on). |
| 67 config("clang_warnings") { |
| 68 if (is_clang) { |
| 69 # Upstream uses self-assignment to avoid warnings. |
| 70 cflags = [ "-Wno-self-assign" ] |
| 71 } |
| 72 } |
74 configs += [ ":clang_warnings" ] | 73 configs += [ ":clang_warnings" ] |
75 } | 74 } |
76 | 75 |
77 if (is_win) { | 76 if (is_win) { |
78 component("libpng") { | 77 component("libpng") { |
79 public_deps = [ | 78 public_deps = [ |
80 ":libpng_sources", | 79 ":libpng_sources", |
81 ] | 80 ] |
82 } | 81 } |
83 } else { | 82 } else { |
84 group("libpng") { | 83 group("libpng") { |
85 public_deps = [ | 84 public_deps = [ |
86 ":libpng_sources", | 85 ":libpng_sources", |
87 ] | 86 ] |
88 } | 87 } |
89 } | 88 } |
OLD | NEW |