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

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 412423002: gn win: Always warnings as errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « no previous file | 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 import("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 if (cpu_arch == "arm") { 6 if (cpu_arch == "arm") {
7 import("//build/config/arm.gni") 7 import("//build/config/arm.gni")
8 } 8 }
9 if (is_posix) { 9 if (is_posix) {
10 import("//build/config/gcc/gcc_version.gni") 10 import("//build/config/gcc/gcc_version.gni")
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 ] 444 ]
445 445
446 } 446 }
447 } 447 }
448 448
449 # chromium_code --------------------------------------------------------------- 449 # chromium_code ---------------------------------------------------------------
450 # 450 #
451 # Toggles between higher and lower warnings for code that is (or isn't) 451 # Toggles between higher and lower warnings for code that is (or isn't)
452 # part of Chromium. 452 # part of Chromium.
453 453
454 # TODO: -Werror and /WX should always be on, independent of chromium_code 454 # TODO: -Werror should always be on, independent of chromium_code
455 # http://crbug.com/393046 455 # http://crbug.com/393046
456 config("chromium_code") { 456 config("chromium_code") {
457 if (is_win) { 457 if (is_win) {
458 cflags = [ 458 cflags = [
459 "/W4", # Warning level 4. 459 "/W4", # Warning level 4.
460 "/WX", # Treat warnings as errors.
461 ] 460 ]
462 } else { 461 } else {
463 cflags = [ 462 cflags = [
464 "-Wall", 463 "-Wall",
465 464
466 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't, 465 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
467 # so we specify it explicitly. 466 # so we specify it explicitly.
468 # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it. 467 # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it.
469 # http://code.google.com/p/chromium/issues/detail?id=90453 468 # http://code.google.com/p/chromium/issues/detail?id=90453
470 "-Wsign-compare", 469 "-Wsign-compare",
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 558
560 # Warnings --------------------------------------------------------------------- 559 # Warnings ---------------------------------------------------------------------
561 # 560 #
562 # This is where we disable various warnings that we've decided aren't 561 # This is where we disable various warnings that we've decided aren't
563 # worthwhile, and enable special warnings. 562 # worthwhile, and enable special warnings.
564 563
565 config("default_warnings") { 564 config("default_warnings") {
566 if (is_win) { 565 if (is_win) {
567 # Please keep ordered and add names if you add more. 566 # Please keep ordered and add names if you add more.
568 cflags = [ 567 cflags = [
568 "/WX", # Treat warnings as errors.
569 "/wd4018", # Comparing signed and unsigned values. 569 "/wd4018", # Comparing signed and unsigned values.
570 "/wd4100", # Unreferenced formal function parameter. 570 "/wd4100", # Unreferenced formal function parameter.
571 "/wd4121", # Alignment of a member was sensitive to packing. 571 "/wd4121", # Alignment of a member was sensitive to packing.
572 "/wd4125", # Decimal digit terminates octal escape sequence. 572 "/wd4125", # Decimal digit terminates octal escape sequence.
573 "/wd4127", # Conditional expression is constant. 573 "/wd4127", # Conditional expression is constant.
574 "/wd4130", # Logical operation on address of string constant. 574 "/wd4130", # Logical operation on address of string constant.
575 "/wd4189", # A variable was declared and initialized but never used. 575 "/wd4189", # A variable was declared and initialized but never used.
576 "/wd4201", # Nonstandard extension used: nameless struct/union. 576 "/wd4201", # Nonstandard extension used: nameless struct/union.
577 "/wd4238", # Nonstandard extension used: class rvalue used as lvalue. 577 "/wd4238", # Nonstandard extension used: class rvalue used as lvalue.
578 "/wd4244", # Conversion: possible loss of data. 578 "/wd4244", # Conversion: possible loss of data.
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 } else { 846 } else {
847 cflags = [ "-g1" ] 847 cflags = [ "-g1" ]
848 } 848 }
849 } 849 }
850 850
851 config("no_symbols") { 851 config("no_symbols") {
852 if (!is_win) { 852 if (!is_win) {
853 cflags = [ "-g0" ] 853 cflags = [ "-g0" ]
854 } 854 }
855 } 855 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698