Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: third_party/libpng/BUILD.gn

Issue 2021403002: Update libpng to 1.6.22 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "CHROME_PNG_WRITE_SUPPORT",
12 "PNG_USER_CONFIG",
13 ]
14
15 if (is_android || is_chromecast) {
16 #'toolsets': ['target', 'host'],
17 defines += [ "CHROME_PNG_READ_PACK_SUPPORT" ] # Required by freetype.
18 }
19 11
20 if (is_win) { 12 if (is_win) {
21 if (is_component_build) { 13 if (is_component_build) {
22 defines += [ 14 defines += [
23 "PNG_USE_DLL", 15 "PNG_USE_DLL",
24 "PNG_NO_MODULEDEF", 16 "PNG_NO_MODULEDEF",
25 ] 17 ]
26 } 18 }
27 } 19 }
28 } 20 }
29 21
30 # 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
31 # appear after this, and turn it back on). 23 # appear after this, and turn it back on).
32 config("clang_warnings") { 24 config("clang_warnings") {
33 if (is_clang) { 25 if (is_clang) {
34 # Upstream uses self-assignment to avoid warnings. 26 # Upstream uses self-assignment to avoid warnings.
35 cflags = [ "-Wno-self-assign" ] 27 cflags = [
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
30 # be false.
31 "-Wno-tautological-constant-out-of-range-compare",
32 ]
36 } 33 }
37 } 34 }
38 35
39 source_set("libpng_sources") { 36 source_set("libpng_sources") {
40 sources = [ 37 sources = [
41 "png.c", 38 "png.c",
42 "png.h", 39 "png.h",
43 "pngconf.h",
44 "pngerror.c", 40 "pngerror.c",
45 "pnggccrd.c",
46 "pngget.c", 41 "pngget.c",
42 "pnglibconf.h",
47 "pngmem.c", 43 "pngmem.c",
48 "pngpread.c", 44 "pngpread.c",
45 "pngprefix.h",
49 "pngread.c", 46 "pngread.c",
50 "pngrio.c", 47 "pngrio.c",
51 "pngrtran.c", 48 "pngrtran.c",
52 "pngrutil.c", 49 "pngrutil.c",
53 "pngset.c", 50 "pngset.c",
54 "pngtrans.c", 51 "pngtrans.c",
55 "pngusr.h",
56 "pngvcrd.c",
57 "pngwio.c", 52 "pngwio.c",
58 "pngwrite.c", 53 "pngwrite.c",
59 "pngwtran.c", 54 "pngwtran.c",
60 "pngwutil.c", 55 "pngwutil.c",
61 ] 56 ]
62 57
58 defines = []
59
60 if (current_cpu == "x86" || current_cpu == "x64") {
61 sources += [
62 "contrib/intel/filter_sse2_intrinsics.c",
63 "contrib/intel/intel_init.c",
64 ]
65 defines += [ "PNG_INTEL_SSE_OPT=1" ]
66 } else if (current_cpu == "arm" || current_cpu == "arm64") {
67 sources += [
68 "arm/arm_init.c",
69 "arm/filter_neon_intrinsics.c",
70 ]
71 defines += [
72 "PNG_ARM_NEON_OPT=2",
73 "PNG_ARM_NEON_IMPLEMENTATION=1",
74 ]
75 }
76
63 configs -= [ "//build/config/compiler:chromium_code" ] 77 configs -= [ "//build/config/compiler:chromium_code" ]
64 configs += [ "//build/config/compiler:no_chromium_code" ] 78 configs += [ "//build/config/compiler:no_chromium_code" ]
65 79
66 if (is_win && is_component_build) { 80 if (is_win && is_component_build) {
67 defines = [ "PNG_BUILD_DLL" ] 81 defines += [ "PNG_BUILD_DLL" ]
68 } 82 }
69 83
70 public_configs = [ ":libpng_config" ] 84 public_configs = [ ":libpng_config" ]
71 85
72 public_deps = [ 86 public_deps = [
73 "//third_party/zlib", 87 "//third_party/zlib",
74 ] 88 ]
75 89
76 configs += [ ":clang_warnings" ] 90 configs += [ ":clang_warnings" ]
77 } 91 }
78 92
79 if (is_win) { 93 if (is_win) {
80 component("libpng") { 94 component("libpng") {
81 public_deps = [ 95 public_deps = [
82 ":libpng_sources", 96 ":libpng_sources",
83 ] 97 ]
84 } 98 }
85 } else { 99 } else {
86 group("libpng") { 100 group("libpng") {
87 public_deps = [ 101 public_deps = [
88 ":libpng_sources", 102 ":libpng_sources",
89 ] 103 ]
90 } 104 }
91 } 105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698