diff options
author | thakis <thakis@chromium.org> | 2015-09-01 11:30:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-01 18:30:50 +0000 |
commit | 0cb5abbf230f3c30e3499d4e787f059ed723dd3c (patch) | |
tree | aee18f03c7d7aec2938243bf5cd1b8d9b491a98f /third_party | |
parent | b6964e616848f11aa1dc6f9ac0a57e2d8d1dac98 (diff) | |
download | chromium_src-0cb5abbf230f3c30e3499d4e787f059ed723dd3c.zip chromium_src-0cb5abbf230f3c30e3499d4e787f059ed723dd3c.tar.gz chromium_src-0cb5abbf230f3c30e3499d4e787f059ed723dd3c.tar.bz2 |
Revert of Un-nest configs in GN files. (patchset #3 id:40001 of https://codereview.chromium.org/1318823008/ )
Reason for revert:
This breaks why these configs exist in the first place and seriously breaks the clang/win gn build (which is what these configs exist for).
Original issue's description:
> 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.
>
> Committed: https://crrev.com/4af2eac8e84692d94f88504ab6e0b244b88dddcb
> Cr-Commit-Position: refs/heads/master@{#346461}
TBR=dpranke@chromium.org,brettw@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1316843006
Cr-Commit-Position: refs/heads/master@{#346695}
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/brotli/BUILD.gn | 23 | ||||
-rw-r--r-- | third_party/cld_2/BUILD.gn | 20 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/BUILD.gn | 65 | ||||
-rw-r--r-- | third_party/hunspell/BUILD.gn | 12 | ||||
-rw-r--r-- | third_party/libpng/BUILD.gn | 17 | ||||
-rw-r--r-- | third_party/libusb/BUILD.gn | 20 | ||||
-rw-r--r-- | third_party/libwebp/BUILD.gn | 13 | ||||
-rw-r--r-- | third_party/libxml/BUILD.gn | 70 | ||||
-rw-r--r-- | third_party/libxslt/BUILD.gn | 31 | ||||
-rw-r--r-- | third_party/lzma_sdk/BUILD.gn | 25 | ||||
-rw-r--r-- | third_party/mesa/BUILD.gn | 18 | ||||
-rw-r--r-- | third_party/snappy/BUILD.gn | 21 | ||||
-rw-r--r-- | third_party/sqlite/BUILD.gn | 41 | ||||
-rw-r--r-- | third_party/usrsctp/BUILD.gn | 21 | ||||
-rw-r--r-- | third_party/yasm/BUILD.gn | 49 | ||||
-rw-r--r-- | third_party/zlib/BUILD.gn | 34 |
16 files changed, 224 insertions, 256 deletions
diff --git a/third_party/brotli/BUILD.gn b/third_party/brotli/BUILD.gn index f18c802..2975f03 100644 --- a/third_party/brotli/BUILD.gn +++ b/third_party/brotli/BUILD.gn @@ -2,15 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -config("brotli_warnings") { - if (is_clang) { - # IncrementalCopyFastPath in decode.c can be unused. - # (The file looks very different upstream, this is probably no longer - # needed after rolling brotli the next time.) - cflags = [ "-Wno-unused-function" ] - } -} - source_set("brotli") { sources = [ "dec/bit_reader.c", @@ -32,11 +23,17 @@ source_set("brotli") { "dec/types.h", ] + config("brotli_warnings") { + if (is_clang) { + # IncrementalCopyFastPath in decode.c can be unused. + # (The file looks very different upstream, this is probably no longer + # needed after rolling brotli the next time.) + cflags = [ "-Wno-unused-function" ] + } + } configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - ":brotli_warnings", - "//build/config/compiler:no_chromium_code", - ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":brotli_warnings" ] # Since we are never debug brotli, freeze the optimizations to -O2. if (is_debug) { diff --git a/third_party/cld_2/BUILD.gn b/third_party/cld_2/BUILD.gn index 9b05615..fc42c4f 100644 --- a/third_party/cld_2/BUILD.gn +++ b/third_party/cld_2/BUILD.gn @@ -33,14 +33,6 @@ cld2_platform_support = "static" cld2_table_size = 2 -config("cld2_data_warnings") { - visibility = [ ":*" ] - if (is_clang) { - # The generated files don't have braces around subobject initializers. - cflags = [ "-Wno-missing-braces" ] - } -} - source_set("cld2_data") { sources = gypi_values.cld2_data_sources if (cld2_table_size == 0) { @@ -54,11 +46,15 @@ source_set("cld2_data") { "src/public", ] + config("cld2_data_warnings") { + if (is_clang) { + # The generated files don't have braces around subobject initializers. + cflags = [ "-Wno-missing-braces" ] + } + } configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - ":cld2_data_warnings", - "//build/config/compiler:no_chromium_code", - ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":cld2_data_warnings" ] } # As in the corresponding gyp file, this just builds the core interfaces for diff --git a/third_party/harfbuzz-ng/BUILD.gn b/third_party/harfbuzz-ng/BUILD.gn index 29573fe..144130a 100644 --- a/third_party/harfbuzz-ng/BUILD.gn +++ b/third_party/harfbuzz-ng/BUILD.gn @@ -41,36 +41,6 @@ if (use_system_harfbuzz) { include_dirs = [ "src" ] } - config("harfbuzz_warnings") { - cflags = [] - if (is_clang) { - cflags += [ - "-Wno-unused-value", - - # Harfbuzz uses unused typedefs for its static asserts (and its - # static asserts are strange enough that they can't be replaced - # by static_assert). - "-Wno-unused-local-typedef", - ] - } - if (is_win) { - # Result of 32-bit shift implicitly converted to 64 bits. - cflags += [ "/wd4334" ] - } - } - - # See also chrome/browser/ui/libgtk2ui/BUILD.gn which pulls this. - config("pangoft2_link_hack") { - if (is_linux && use_pango && !is_chromeos && !is_official_build && - current_cpu != "arm" && current_cpu != "mipsel" && - !is_component_build) { - # These symbols are referenced from libpangoft2, which will be - # dynamically linked later. - ldflags = - [ "-Wl,-uhb_ft_face_create_cached,-uhb_glib_get_unicode_funcs" ] - } - } - static_library("harfbuzz-ng") { sources = [ "src/hb-atomic-private.hh", @@ -176,10 +146,26 @@ if (use_system_harfbuzz) { ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - ":harfbuzz_warnings", - "//build/config/compiler:no_chromium_code", - ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + config("harfbuzz_warnings") { + cflags = [] + if (is_clang) { + cflags += [ + "-Wno-unused-value", + + # Harfbuzz uses unused typedefs for its static asserts (and its + # static asserts are strange enough that they can't be replaced + # by static_assert). + "-Wno-unused-local-typedef", + ] + } + if (is_win) { + cflags += [ "/wd4334" ] # Result of 32-bit shift implicitly converted to 64 bits. + } + } + configs += [ ":harfbuzz_warnings" ] + public_configs = [ ":harfbuzz-ng_config" ] deps = [ @@ -213,5 +199,16 @@ if (use_system_harfbuzz) { ] } + # See also chrome/browser/ui/libgtk2ui/BUILD.gn which pulls this. + config("pangoft2_link_hack") { + if (is_linux && use_pango && !is_chromeos && !is_official_build && + current_cpu != "arm" && current_cpu != "mipsel" && + !is_component_build) { + # These symbols are referenced from libpangoft2, which will be + # dynamically linked later. + ldflags = + [ "-Wl,-uhb_ft_face_create_cached,-uhb_glib_get_unicode_funcs" ] + } + } } } diff --git a/third_party/hunspell/BUILD.gn b/third_party/hunspell/BUILD.gn index 84f0ae7..9e9f249 100644 --- a/third_party/hunspell/BUILD.gn +++ b/third_party/hunspell/BUILD.gn @@ -10,12 +10,6 @@ config("hunspell_config") { ] } -config("hunspell_warnings") { - if (is_clang) { - cflags = [ "-Wno-unused-private-field" ] - } -} - source_set("hunspell") { sources = [ "google/bdict.cc", @@ -57,6 +51,12 @@ source_set("hunspell") { "src/parsers/textparser.hxx", ] + config("hunspell_warnings") { + if (is_clang) { + cflags = [ "-Wno-unused-private-field" ] + } + } + configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", diff --git a/third_party/libpng/BUILD.gn b/third_party/libpng/BUILD.gn index 2142059..c4e2650c 100644 --- a/third_party/libpng/BUILD.gn +++ b/third_party/libpng/BUILD.gn @@ -25,15 +25,6 @@ config("libpng_config") { } } -# Must be in a config because of how GN orders flags (otherwise -Wall will -# appear after this, and turn it back on). -config("clang_warnings") { - if (is_clang) { - # Upstream uses self-assignment to avoid warnings. - cflags = [ "-Wno-self-assign" ] - } -} - source_set("libpng_sources") { sources = [ "png.c", @@ -71,6 +62,14 @@ source_set("libpng_sources") { "//third_party/zlib", ] + # Must be in a config because of how GN orders flags (otherwise -Wall will + # appear after this, and turn it back on). + config("clang_warnings") { + if (is_clang) { + # Upstream uses self-assignment to avoid warnings. + cflags = [ "-Wno-self-assign" ] + } + } configs += [ ":clang_warnings" ] } diff --git a/third_party/libusb/BUILD.gn b/third_party/libusb/BUILD.gn index 82aeabd..cce639e 100644 --- a/third_party/libusb/BUILD.gn +++ b/third_party/libusb/BUILD.gn @@ -10,17 +10,6 @@ config("libusb_config") { include_dirs = [ "src/libusb" ] } -config("libusb_warnings") { - visibility = [ ":*" ] - if (is_clang) { - # guid_eq in windows_usb.c is unused. - cflags = [ "-Wno-unused-function" ] - if (is_linux && !use_udev) { - cflags += [ "-Wno-pointer-sign" ] - } - } -} - static_library("libusb") { sources = [ "src/config.h", @@ -57,6 +46,15 @@ static_library("libusb") { deps = [] include_dirs = [ "src/libusb/os" ] + config("libusb_warnings") { + if (is_clang) { + # guid_eq in windows_usb.c is unused. + cflags = [ "-Wno-unused-function" ] + if (is_linux && !use_udev) { + cflags += [ "-Wno-pointer-sign" ] + } + } + } configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] configs += [ ":libusb_warnings" ] diff --git a/third_party/libwebp/BUILD.gn b/third_party/libwebp/BUILD.gn index d52e1da..3259ec3 100644 --- a/third_party/libwebp/BUILD.gn +++ b/third_party/libwebp/BUILD.gn @@ -162,13 +162,6 @@ source_set("libwebp_enc") { ] } -config("libwebp_utils_warnings") { - if (is_clang) { - # See https://code.google.com/p/webp/issues/detail?id=253. - cflags = [ "-Wno-incompatible-pointer-types" ] - } -} - source_set("libwebp_utils") { sources = [ "utils/bit_reader.c", @@ -189,6 +182,12 @@ source_set("libwebp_utils") { all_dependent_configs = [ ":libwebp_config" ] + config("libwebp_utils_warnings") { + if (is_clang) { + # See https://code.google.com/p/webp/issues/detail?id=253. + cflags = [ "-Wno-incompatible-pointer-types" ] + } + } public_configs = [ ":libwebp_utils_warnings" ] } diff --git a/third_party/libxml/BUILD.gn b/third_party/libxml/BUILD.gn index 39b5962..c967608 100644 --- a/third_party/libxml/BUILD.gn +++ b/third_party/libxml/BUILD.gn @@ -24,38 +24,6 @@ config("libxml_config") { ] } -config("libxml_warnings") { - if (is_clang) { - cflags = [ - # libxml passes `const unsigned char*` through `const char*`. - "-Wno-pointer-sign", - - # pattern.c and uri.c both have an intentional `for (...);` / - # `while(...);` loop. I submitted a patch to move the `'` to its own - # line, but until that's landed suppress the warning: - "-Wno-empty-body", - - # debugXML.c compares array 'arg' to NULL. - "-Wno-tautological-pointer-compare", - - # threads.c attempts to forward declare a pthread_equal which doesn't - # match the prototype in pthreads.h - "-Wno-ignored-attributes", - - # libxml casts from int to long to void*. - "-Wno-int-to-void-pointer-cast", - - # libxml passes a volatile LPCRITICAL_SECTION* to a function expecting - # a void* volatile*. - "-Wno-incompatible-pointer-types", - - # trio_is_special_quantity and trio_is_negative are only - # used with certain preprocessor defines set. - "-Wno-unused-function", - ] - } -} - static_library("libxml") { output_name = "libxml2" sources = [ @@ -176,10 +144,7 @@ static_library("libxml") { ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - ":libxml_warnings", - "//build/config/compiler:no_chromium_code", - ] + configs += [ "//build/config/compiler:no_chromium_code" ] public_configs = [ ":libxml_config" ] public_deps = [ @@ -202,5 +167,38 @@ static_library("libxml") { defines = [ "_REENTRANT" ] } + config("libxml_warnings") { + if (is_clang) { + cflags = [ + # libxml passes `const unsigned char*` through `const char*`. + "-Wno-pointer-sign", + + # pattern.c and uri.c both have an intentional `for (...);` / + # `while(...);` loop. I submitted a patch to move the `'` to its own + # line, but until that's landed suppress the warning: + "-Wno-empty-body", + + # debugXML.c compares array 'arg' to NULL. + "-Wno-tautological-pointer-compare", + + # threads.c attempts to forward declare a pthread_equal which doesn't + # match the prototype in pthreads.h + "-Wno-ignored-attributes", + + # libxml casts from int to long to void*. + "-Wno-int-to-void-pointer-cast", + + # libxml passes a volatile LPCRITICAL_SECTION* to a function expecting + # a void* volatile*. + "-Wno-incompatible-pointer-types", + + # trio_is_special_quantity and trio_is_negative are only + # used with certain preprocessor defines set. + "-Wno-unused-function", + ] + } + } + configs += [ ":libxml_warnings" ] + include_dirs = [ "$os_include" ] } diff --git a/third_party/libxslt/BUILD.gn b/third_party/libxslt/BUILD.gn index 1ecb11c..6b46db3 100644 --- a/third_party/libxslt/BUILD.gn +++ b/third_party/libxslt/BUILD.gn @@ -7,19 +7,6 @@ config("libxslt_config") { include_dirs = [ "." ] } -config("libxslt_warnings") { - if (is_clang) { - cflags = [ - # libxslt stores a char[3] in a `const unsigned char*`. - "-Wno-pointer-sign", - - # xsltDefaultRegion and xsltCalibrateTimestamps are only - # used with certain preprocessor defines set. - "-Wno-unused-function", - ] - } -} - static_library("libxslt") { sources = [ "libxslt/attributes.c", @@ -72,11 +59,21 @@ static_library("libxslt") { "win32/config.h", ] + config("libxslt_warnings") { + if (is_clang) { + cflags = [ + # libxslt stores a char[3] in a `const unsigned char*`. + "-Wno-pointer-sign", + + # xsltDefaultRegion and xsltCalibrateTimestamps are only + # used with certain preprocessor defines set. + "-Wno-unused-function", + ] + } + } configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - ":libxslt_warnings", - "//build/config/compiler:no_chromium_code", - ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":libxslt_warnings" ] public_configs = [ ":libxslt_config" ] cflags = [] diff --git a/third_party/lzma_sdk/BUILD.gn b/third_party/lzma_sdk/BUILD.gn index 74fff2d..2afe7b4 100644 --- a/third_party/lzma_sdk/BUILD.gn +++ b/third_party/lzma_sdk/BUILD.gn @@ -6,15 +6,6 @@ config("lzma_sdk_config") { include_dirs = [ "." ] } -# Must be in a config because of how GN orders flags (otherwise -Wall will -# appear after this, and turn it back on). -config("clang_warnings") { - if (is_clang) { - # Upstream uses self-assignment to avoid warnings. - cflags = [ "-Wno-self-assign" ] - } -} - static_library("lzma_sdk") { sources = [ "7z.h", @@ -59,9 +50,17 @@ static_library("lzma_sdk") { ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - ":clang_warnings", - "//build/config/compiler:no_chromium_code", - ] + configs += [ "//build/config/compiler:no_chromium_code" ] + public_configs = [ ":lzma_sdk_config" ] + + # Must be in a config because of how GN orders flags (otherwise -Wall will + # appear after this, and turn it back on). + config("clang_warnings") { + if (is_clang) { + # Upstream uses self-assignment to avoid warnings. + cflags = [ "-Wno-self-assign" ] + } + } + configs += [ ":clang_warnings" ] } diff --git a/third_party/mesa/BUILD.gn b/third_party/mesa/BUILD.gn index 58cb60c..052401f 100644 --- a/third_party/mesa/BUILD.gn +++ b/third_party/mesa/BUILD.gn @@ -148,15 +148,6 @@ config("mesa_internal_warnings") { } } -config("mesa_libglslcommon_warnings") { - if (is_clang) { - cflags = [ - # https://bugs.freedesktop.org/show_bug.cgi?id=91645: - "-Wno-overloaded-virtual", - ] - } -} - static_library("mesa_libglslcommon") { sources = [ "$generated_src_dir/mesa/glcpp-lex.c", @@ -261,6 +252,15 @@ static_library("mesa_libglslcommon") { "src/src/glsl/strtod.h", ] + config("mesa_libglslcommon_warnings") { + if (is_clang) { + cflags = [ + # https://bugs.freedesktop.org/show_bug.cgi?id=91645: + "-Wno-overloaded-virtual", + ] + } + } + configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] previous_configs = configs diff --git a/third_party/snappy/BUILD.gn b/third_party/snappy/BUILD.gn index 8ab472d..97cce89 100644 --- a/third_party/snappy/BUILD.gn +++ b/third_party/snappy/BUILD.gn @@ -16,14 +16,6 @@ config("snappy_config") { } } -config("snappy_warnings") { - if (is_clang) { - # ComputeTable is unused, - # https://code.google.com/p/snappy/issues/detail?id=96 - cflags = [ "-Wno-unused-function" ] - } -} - static_library("snappy") { sources = [ "src/snappy-internal.h", @@ -35,11 +27,16 @@ static_library("snappy") { "src/snappy.h", ] + config("snappy_warnings") { + if (is_clang) { + # ComputeTable is unused, + # https://code.google.com/p/snappy/issues/detail?id=96 + cflags = [ "-Wno-unused-function" ] + } + } configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - ":snappy_warnings", - "//build/config/compiler:no_chromium_code", - ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":snappy_warnings" ] public_configs = [ ":snappy_config" ] if (is_win) { diff --git a/third_party/sqlite/BUILD.gn b/third_party/sqlite/BUILD.gn index ac14a2c..92d0d88 100644 --- a/third_party/sqlite/BUILD.gn +++ b/third_party/sqlite/BUILD.gn @@ -14,27 +14,6 @@ if (!use_system_sqlite) { include_dirs = [ "." ] } - config("sqlite_warnings") { - cflags = [] - if (is_clang) { - # sqlite contains a few functions that are unused, at least on - # Windows with Chromium's sqlite patches applied - # (interiorCursorEOF fts3EvalDeferredPhrase - # fts3EvalSelectDeferred sqlite3Fts3InitHashTable - # sqlite3Fts3InitTok). - cflags += [ "-Wno-unused-function" ] - } - if (is_linux) { - cflags += [ - # SQLite doesn"t believe in compiler warnings, - # preferring testing. - # http://www.sqlite.org/faq.html#q17 - "-Wno-int-to-pointer-cast", - "-Wno-pointer-to-int-cast", - ] - } - } - source_set("sqlite") { sources = [ "amalgamation/sqlite3.c", @@ -78,6 +57,26 @@ if (!use_system_sqlite) { include_dirs = [ "amalgamation" ] + config("sqlite_warnings") { + cflags = [] + if (is_clang) { + # sqlite contains a few functions that are unused, at least on + # Windows with Chromium's sqlite patches applied + # (interiorCursorEOF fts3EvalDeferredPhrase + # fts3EvalSelectDeferred sqlite3Fts3InitHashTable + # sqlite3Fts3InitTok). + cflags += [ "-Wno-unused-function" ] + } + if (is_linux) { + cflags += [ + # SQLite doesn"t believe in compiler warnings, + # preferring testing. + # http://www.sqlite.org/faq.html#q17 + "-Wno-int-to-pointer-cast", + "-Wno-pointer-to-int-cast", + ] + } + } configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] configs += [ ":sqlite_warnings" ] diff --git a/third_party/usrsctp/BUILD.gn b/third_party/usrsctp/BUILD.gn index 3accc19..bbea24b 100644 --- a/third_party/usrsctp/BUILD.gn +++ b/third_party/usrsctp/BUILD.gn @@ -11,13 +11,6 @@ config("usrsctp_config") { ] } -config("usrsctp_warnings") { - if (is_clang) { - # atomic_init in user_atomic.h is a static function in a header. - cflags = [ "-Wno-unused-function" ] - } -} - static_library("usrsctp") { sources = [ "usrsctplib/netinet/sctp.h", @@ -91,12 +84,16 @@ static_library("usrsctp") { # "SCTP_DEBUG", # Uncomment for SCTP debugging. ] + config("usrsctp_warnings") { + if (is_clang) { + # atomic_init in user_atomic.h is a static function in a header. + cflags = [ "-Wno-unused-function" ] + } + } configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - ":usrsctp_warnings", - "//build/config/compiler:no_chromium_code", - "//build/config/compiler:no_incompatible_pointer_warnings", - ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ "//build/config/compiler:no_incompatible_pointer_warnings" ] + configs += [ ":usrsctp_warnings" ] public_configs = [ ":usrsctp_config" ] diff --git a/third_party/yasm/BUILD.gn b/third_party/yasm/BUILD.gn index b301a10..fcb779a 100644 --- a/third_party/yasm/BUILD.gn +++ b/third_party/yasm/BUILD.gn @@ -135,20 +135,6 @@ if (current_toolchain == host_toolchain) { ] } - config("re2c_warnings") { - # re2c is missing CLOSEVOP from one switch. - if (is_clang) { - cflags = [ - # re2c is missing CLOSEVOP from one switch. - "-Wno-switch", - - # re2c contains many static functions in headers (because it's - # a C library predating C99.) - "-Wno-unused-function", - ] - } - } - executable("re2c") { sources = [ "source/patched-yasm/tools/re2c/actions.c", @@ -162,26 +148,30 @@ if (current_toolchain == host_toolchain) { "source/patched-yasm/tools/re2c/translate.c", ] + config("re2c_warnings") { + # re2c is missing CLOSEVOP from one switch. + if (is_clang) { + cflags = [ + # re2c is missing CLOSEVOP from one switch. + "-Wno-switch", + + # re2c contains many static functions in headers (because it's + # a C library predating C99.) + "-Wno-unused-function", + ] + } + } configs -= [ "//build/config/compiler:chromium_code" ] configs += [ - ":re2c_warnings", ":yasm_config", "//build/config/compiler:no_chromium_code", + ":re2c_warnings", ] deps = [ "//build/config/sanitizers:deps", ] } - config("yasm_warnings") { - if (is_clang) { - cflags = [ - # reg3264type in x86expr.c is unused. - "-Wno-unused-local-typedef", - ] - } - } - executable("yasm") { sources = [ "source/patched-yasm/frontends/yasm/yasm-options.c", @@ -268,11 +258,20 @@ if (current_toolchain == host_toolchain) { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ ":yasm_config", - ":yasm_warnings", "//build/config/compiler:no_chromium_code", "//build/config/compiler:no_incompatible_pointer_warnings", ] + config("yasm_warnings") { + if (is_clang) { + cflags = [ + # reg3264type in x86expr.c is unused. + "-Wno-unused-local-typedef", + ] + } + } + configs += [ ":yasm_warnings" ] + # Yasm generates a bunch of .c files which its source file #include. # Add the |target_gen_dir| into the include path so it can find them. # Ideally, these generated .c files would be placed into a separate diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn index 66e0305..0d59218 100644 --- a/third_party/zlib/BUILD.gn +++ b/third_party/zlib/BUILD.gn @@ -28,13 +28,6 @@ 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. @@ -74,13 +67,17 @@ 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 += [ - ":zlib_warnings", - "//build/config/compiler:no_chromium_code", - ] + configs += [ "//build/config/compiler:no_chromium_code" ] public_configs = [ ":zlib_config" ] deps = [ @@ -88,14 +85,6 @@ 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", @@ -124,6 +113,13 @@ 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" ] |