Skip to content
Snippets Groups Projects
Commit 69eb36f1 authored by brettw's avatar brettw Committed by Commit bot
Browse files

Un-nest configs in GN files.

People sometimes nest targets or configs, usually with the assumption that this limits the visibility of a config to within a target. But this nesting provides no visibility restrictions over declaring it outside of a block.

Un-nest for clarity.

Review URL: https://codereview.chromium.org/1318823008

Cr-Original-Commit-Position: refs/heads/master@{#346461}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4af2eac8e84692d94f88504ab6e0b244b88dddcb
parent 79a7f67d
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,13 @@ static_library("zlib_x86_simd") {
configs += [ "//build/config/compiler:no_chromium_code" ]
}
config("zlib_warnings") {
if (is_clang && !is_ios &&
(current_cpu == "x86" || current_cpu == "x64")) {
cflags = [ "-Wno-incompatible-pointer-types" ]
}
}
static_library("zlib") {
if (!is_win) {
# Don't stomp on "libzlib" on other platforms.
......@@ -67,17 +74,13 @@ static_library("zlib") {
if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) {
sources += [ "x86.c" ]
config("zlib_warnings") {
if (is_clang) {
cflags = [ "-Wno-incompatible-pointer-types" ]
}
}
configs += [ ":zlib_warnings" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [
":zlib_warnings",
"//build/config/compiler:no_chromium_code",
]
public_configs = [ ":zlib_config" ]
deps = [
......@@ -85,6 +88,14 @@ static_library("zlib") {
]
}
config("minizip_warnings") {
visibility = [ ":*" ]
if (is_clang) {
# zlib uses `if ((a == b))` for some reason.
cflags = [ "-Wno-parentheses-equality" ]
}
}
static_library("minizip") {
sources = [
"contrib/minizip/ioapi.c",
......@@ -113,13 +124,6 @@ static_library("minizip") {
":zlib",
]
config("minizip_warnings") {
if (is_clang) {
# zlib uses `if ((a == b))` for some reason.
cflags = [ "-Wno-parentheses-equality" ]
}
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":minizip_warnings" ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment