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

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

Issue 1307223010: Un-nest configs in GN files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 3 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
« no previous file with comments | « third_party/yasm/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 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("zlib_config") { 5 config("zlib_config") {
6 include_dirs = [ "." ] 6 include_dirs = [ "." ]
7 } 7 }
8 8
9 static_library("zlib_x86_simd") { 9 static_library("zlib_x86_simd") {
10 if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) { 10 if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) {
(...skipping 10 matching lines...) Expand all
21 } else { 21 } else {
22 sources = [ 22 sources = [
23 "simd_stub.c", 23 "simd_stub.c",
24 ] 24 ]
25 } 25 }
26 26
27 configs -= [ "//build/config/compiler:chromium_code" ] 27 configs -= [ "//build/config/compiler:chromium_code" ]
28 configs += [ "//build/config/compiler:no_chromium_code" ] 28 configs += [ "//build/config/compiler:no_chromium_code" ]
29 } 29 }
30 30
31 config("zlib_warnings") {
32 if (is_clang && !is_ios &&
33 (current_cpu == "x86" || current_cpu == "x64")) {
34 cflags = [ "-Wno-incompatible-pointer-types" ]
35 }
36 }
37
31 static_library("zlib") { 38 static_library("zlib") {
32 if (!is_win) { 39 if (!is_win) {
33 # Don't stomp on "libzlib" on other platforms. 40 # Don't stomp on "libzlib" on other platforms.
34 output_name = "chrome_zlib" 41 output_name = "chrome_zlib"
35 } 42 }
36 43
37 sources = [ 44 sources = [
38 "adler32.c", 45 "adler32.c",
39 "compress.c", 46 "compress.c",
40 "crc32.c", 47 "crc32.c",
(...skipping 19 matching lines...) Expand all
60 "uncompr.c", 67 "uncompr.c",
61 "x86.h", 68 "x86.h",
62 "zconf.h", 69 "zconf.h",
63 "zlib.h", 70 "zlib.h",
64 "zutil.c", 71 "zutil.c",
65 "zutil.h", 72 "zutil.h",
66 ] 73 ]
67 74
68 if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) { 75 if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) {
69 sources += [ "x86.c" ] 76 sources += [ "x86.c" ]
70
71 config("zlib_warnings") {
72 if (is_clang) {
73 cflags = [ "-Wno-incompatible-pointer-types" ]
74 }
75 }
76 configs += [ ":zlib_warnings" ]
77 } 77 }
78 78
79 configs -= [ "//build/config/compiler:chromium_code" ] 79 configs -= [ "//build/config/compiler:chromium_code" ]
80 configs += [ "//build/config/compiler:no_chromium_code" ] 80 configs += [
81 "//build/config/compiler:no_chromium_code",
82
83 # Must be after no_chromium_code for warning flags to be ordered correctly.
84 ":zlib_warnings",
85 ]
81 86
82 public_configs = [ ":zlib_config" ] 87 public_configs = [ ":zlib_config" ]
83 deps = [ 88 deps = [
84 ":zlib_x86_simd", 89 ":zlib_x86_simd",
85 ] 90 ]
86 } 91 }
87 92
93 config("minizip_warnings") {
94 visibility = [ ":*" ]
95 if (is_clang) {
96 # zlib uses `if ((a == b))` for some reason.
97 cflags = [ "-Wno-parentheses-equality" ]
98 }
99 }
100
88 static_library("minizip") { 101 static_library("minizip") {
89 sources = [ 102 sources = [
90 "contrib/minizip/ioapi.c", 103 "contrib/minizip/ioapi.c",
91 "contrib/minizip/ioapi.h", 104 "contrib/minizip/ioapi.h",
92 "contrib/minizip/iowin32.c", 105 "contrib/minizip/iowin32.c",
93 "contrib/minizip/iowin32.h", 106 "contrib/minizip/iowin32.h",
94 "contrib/minizip/unzip.c", 107 "contrib/minizip/unzip.c",
95 "contrib/minizip/unzip.h", 108 "contrib/minizip/unzip.h",
96 "contrib/minizip/zip.c", 109 "contrib/minizip/zip.c",
97 "contrib/minizip/zip.h", 110 "contrib/minizip/zip.h",
98 ] 111 ]
99 112
100 if (!is_win) { 113 if (!is_win) {
101 sources -= [ 114 sources -= [
102 "contrib/minizip/iowin32.c", 115 "contrib/minizip/iowin32.c",
103 "contrib/minizip/iowin32.h", 116 "contrib/minizip/iowin32.h",
104 ] 117 ]
105 } 118 }
106 if (is_mac || is_ios || is_android) { 119 if (is_mac || is_ios || is_android) {
107 # Mac, Android and the BSDs don't have fopen64, ftello64, or fseeko64. We 120 # Mac, Android and the BSDs don't have fopen64, ftello64, or fseeko64. We
108 # use fopen, ftell, and fseek instead on these systems. 121 # use fopen, ftell, and fseek instead on these systems.
109 defines = [ "USE_FILE32API" ] 122 defines = [ "USE_FILE32API" ]
110 } 123 }
111 124
112 deps = [ 125 deps = [
113 ":zlib", 126 ":zlib",
114 ] 127 ]
115 128
116 config("minizip_warnings") { 129 configs -= [ "//build/config/compiler:chromium_code" ]
117 if (is_clang) { 130 configs += [
118 # zlib uses `if ((a == b))` for some reason. 131 "//build/config/compiler:no_chromium_code",
119 cflags = [ "-Wno-parentheses-equality" ]
120 }
121 }
122 132
123 configs -= [ "//build/config/compiler:chromium_code" ] 133 # Must be after no_chromium_code for warning flags to be ordered correctly.
124 configs += [ "//build/config/compiler:no_chromium_code" ] 134 ":minizip_warnings",
125 configs += [ ":minizip_warnings" ] 135 ]
126 public_configs = [ ":zlib_config" ] 136 public_configs = [ ":zlib_config" ]
127 } 137 }
128 138
129 static_library("zip") { 139 static_library("zip") {
130 sources = [ 140 sources = [
131 "google/zip.cc", 141 "google/zip.cc",
132 "google/zip.h", 142 "google/zip.h",
133 "google/zip_internal.cc", 143 "google/zip_internal.cc",
134 "google/zip_internal.h", 144 "google/zip_internal.h",
135 "google/zip_reader.cc", 145 "google/zip_reader.cc",
136 "google/zip_reader.h", 146 "google/zip_reader.h",
137 ] 147 ]
138 deps = [ 148 deps = [
139 ":minizip", 149 ":minizip",
140 "//base", 150 "//base",
141 ] 151 ]
142 } 152 }
OLDNEW
« no previous file with comments | « third_party/yasm/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698