OLD | NEW |
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 Loading... |
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 |
| 455 # http://crbug.com/393046 |
454 config("chromium_code") { | 456 config("chromium_code") { |
455 if (is_win) { | 457 if (is_win) { |
456 cflags = [ | 458 cflags = [ |
457 "/W4", # Warning level 4. | 459 "/W4", # Warning level 4. |
458 "/WX", # Treat warnings as errors. | 460 "/WX", # Treat warnings as errors. |
459 ] | 461 ] |
460 } else { | 462 } else { |
461 cflags = [ | 463 cflags = [ |
462 "-Wall", | 464 "-Wall", |
463 "-Werror", | |
464 | 465 |
465 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't, | 466 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't, |
466 # so we specify it explicitly. | 467 # so we specify it explicitly. |
467 # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it. | 468 # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it. |
468 # http://code.google.com/p/chromium/issues/detail?id=90453 | 469 # http://code.google.com/p/chromium/issues/detail?id=90453 |
469 "-Wsign-compare", | 470 "-Wsign-compare", |
470 ] | 471 ] |
| 472 if (!is_linux) { |
| 473 # TODO: Add this unconditionally once linux builds without warnings with |
| 474 # clang in the gn build. |
| 475 cflags += [ "-Werror" ] |
| 476 } |
471 | 477 |
472 # In Chromium code, we define __STDC_foo_MACROS in order to get the | 478 # In Chromium code, we define __STDC_foo_MACROS in order to get the |
473 # C99 macros on Mac and Linux. | 479 # C99 macros on Mac and Linux. |
474 defines = [ | 480 defines = [ |
475 "__STDC_CONSTANT_MACROS", | 481 "__STDC_CONSTANT_MACROS", |
476 "__STDC_FORMAT_MACROS", | 482 "__STDC_FORMAT_MACROS", |
477 ] | 483 ] |
478 | 484 |
479 # TODO(brettw) this should also be enabled on Linux but some files | 485 # TODO(brettw) this should also be enabled on Linux but some files |
480 # currently fail. | 486 # currently fail. |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 } else { | 846 } else { |
841 cflags = [ "-g1" ] | 847 cflags = [ "-g1" ] |
842 } | 848 } |
843 } | 849 } |
844 | 850 |
845 config("no_symbols") { | 851 config("no_symbols") { |
846 if (!is_win) { | 852 if (!is_win) { |
847 cflags = [ "-g0" ] | 853 cflags = [ "-g0" ] |
848 } | 854 } |
849 } | 855 } |
OLD | NEW |