Chromium Code Reviews| 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/allocator.gni") | 5 import("//build/config/allocator.gni") |
| 6 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
| 7 import("//build/config/chromecast_build.gni") | 7 import("//build/config/chromecast_build.gni") |
| 8 import("//build/config/crypto.gni") | 8 import("//build/config/crypto.gni") |
| 9 import("//build/config/features.gni") | 9 import("//build/config/features.gni") |
| 10 import("//build/config/sanitizers/sanitizers.gni") | 10 import("//build/config/sanitizers/sanitizers.gni") |
| 11 import("//build/config/ui.gni") | 11 import("//build/config/ui.gni") |
| 12 import("//build/toolchain/goma.gni") | 12 import("//build/toolchain/goma.gni") |
| 13 | 13 |
| 14 declare_args() { | 14 declare_args() { |
| 15 # When set (the default) enables C++ iterator debugging in debug builds. | 15 # When set (the default) enables C++ iterator debugging in debug builds. |
| 16 # Iterator debugging is always off in release builds (technically, this flag | 16 # Iterator debugging is always off in release builds (technically, this flag |
| 17 # affects the "debug" config, which is always available but applied by | 17 # affects the "debug" config, which is always available but applied by |
| 18 # default only in debug builds). | 18 # default only in debug builds). |
| 19 # | 19 # |
| 20 # Iterator debugging is generally useful for catching bugs. But it can | 20 # Iterator debugging is generally useful for catching bugs. But it can |
| 21 # introduce extra locking to check the state of an iterator against the state | 21 # introduce extra locking to check the state of an iterator against the state |
| 22 # of the current object. For iterator- and thread-heavy code, this can | 22 # of the current object. For iterator- and thread-heavy code, this can |
| 23 # significantly slow execution. | 23 # significantly slow execution. |
| 24 enable_iterator_debugging = true | 24 enable_iterator_debugging = true |
| 25 | 25 |
| 26 # Set to true to enable dcheck in Release builds. | 26 # Set to true to enable dcheck in Release builds. |
| 27 dcheck_always_on = false | 27 dcheck_always_on = false |
| 28 } | 28 } |
| 29 | 29 |
| 30 # Because of the source assignment filter, many targets end up over-filtering | |
| 31 # their sources if the output directory contains a platform name. Assert that | |
| 32 # this doesn't happen. http://crbug.com/548283 | |
| 33 template("assert_valid_out_dir") { | |
| 34 assert(target_name != "") # Mark as used. | |
| 35 set_sources_assignment_filter([ | |
|
brettw
2016/02/16 19:19:58
This is a clever idea!
I *think* the default sour
agrieve
2016/02/16 20:04:20
I had thought the same, but then figured it wouldn
| |
| 36 "*\bandroid/*", | |
| 37 "*\bchromeos/*", | |
| 38 "*\bcocoa/*", | |
| 39 "*\bios/*", | |
| 40 "*\blinux/*", | |
| 41 "*\bmac/*", | |
| 42 "*\bposix/*", | |
| 43 "*\bwin/*", | |
| 44 ]) | |
| 45 | |
| 46 assert( | |
| 47 invoker.sources == invoker.actual_sources, | |
| 48 "Do not use a platform name in your output directory (found \"$root_build_ dir\"). http://crbug.com/548283") | |
| 49 } | |
| 50 | |
| 51 assert_valid_out_dir("_check_output_dir_has_no_platform_name") { | |
| 52 actual_sources = [ "$root_build_dir/foo" ] | |
| 53 sources = actual_sources | |
| 54 } | |
| 55 | |
| 30 # TODO(brettw) Most of these should be removed. Instead of global feature | 56 # TODO(brettw) Most of these should be removed. Instead of global feature |
| 31 # flags, we should have more modular flags that apply only to a target and its | 57 # flags, we should have more modular flags that apply only to a target and its |
| 32 # dependents. For example, depending on the "x11" meta-target should define | 58 # dependents. For example, depending on the "x11" meta-target should define |
| 33 # USE_X11 for all dependents so that everything that could use X11 gets the | 59 # USE_X11 for all dependents so that everything that could use X11 gets the |
| 34 # define, but anything that doesn't depend on X11 doesn't see it. | 60 # define, but anything that doesn't depend on X11 doesn't see it. |
| 35 # | 61 # |
| 36 # For now we define these globally to match the current GYP build. | 62 # For now we define these globally to match the current GYP build. |
| 37 config("feature_flags") { | 63 config("feature_flags") { |
| 38 # TODO(brettw) this probably needs to be parameterized. | 64 # TODO(brettw) this probably needs to be parameterized. |
| 39 defines = [ | 65 defines = [ |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 461 # This error doesn't happen every time. In VS2013, it seems if the .pch | 487 # This error doesn't happen every time. In VS2013, it seems if the .pch |
| 462 # file doesn't exist, no error will be generated (probably MS tested this | 488 # file doesn't exist, no error will be generated (probably MS tested this |
| 463 # case but forgot the other one?). To reproduce this error, do a build, | 489 # case but forgot the other one?). To reproduce this error, do a build, |
| 464 # then delete the precompile.c.obj file, then build again. | 490 # then delete the precompile.c.obj file, then build again. |
| 465 cflags_c = [ "/wd4206" ] | 491 cflags_c = [ "/wd4206" ] |
| 466 } else if (is_mac && !is_official_build && !use_goma) { | 492 } else if (is_mac && !is_official_build && !use_goma) { |
| 467 precompiled_header = "build/precompile.h" | 493 precompiled_header = "build/precompile.h" |
| 468 precompiled_source = "//build/precompile.h" | 494 precompiled_source = "//build/precompile.h" |
| 469 } | 495 } |
| 470 } | 496 } |
| OLD | NEW |