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 # One common error that happens is that GYP-generated headers within gen/ get | 14 # One common error that happens is that GYP-generated headers within gen/ get |
15 # included rather than the GN-generated ones within gen/ subdirectories. | 15 # included rather than the GN-generated ones within gen/ subdirectories. |
16 # TODO(agrieve): Remove once GYP is gone (as well as exec_script exception). | 16 # TODO(GYP_GONE): Remove once GYP is gone (as well as exec_script exception). |
17 assert( | 17 assert( |
18 exec_script("//build/dir_exists.py", [ "obj.host" ], "string") == "False", | 18 exec_script("//build/dir_exists.py", [ "obj.host" ], "string") == "False", |
19 "GYP artifacts detected in $root_build_dir.$0x0A" + | 19 "GYP artifacts detected in $root_build_dir.$0x0A" + |
20 "You must wipe this directory before building with GN.") | 20 "You must wipe this directory before building with GN.") |
21 | 21 |
22 declare_args() { | 22 declare_args() { |
23 # When set (the default) enables C++ iterator debugging in debug builds. | 23 # When set (the default) enables C++ iterator debugging in debug builds. |
24 # Iterator debugging is always off in release builds (technically, this flag | 24 # Iterator debugging is always off in release builds (technically, this flag |
25 # affects the "debug" config, which is always available but applied by | 25 # affects the "debug" config, which is always available but applied by |
26 # default only in debug builds). | 26 # default only in debug builds). |
(...skipping 14 matching lines...) Expand all Loading... |
41 } | 41 } |
42 | 42 |
43 # TODO(brettw) Most of these should be removed. Instead of global feature | 43 # TODO(brettw) Most of these should be removed. Instead of global feature |
44 # flags, we should have more modular flags that apply only to a target and its | 44 # flags, we should have more modular flags that apply only to a target and its |
45 # dependents. For example, depending on the "x11" meta-target should define | 45 # dependents. For example, depending on the "x11" meta-target should define |
46 # USE_X11 for all dependents so that everything that could use X11 gets the | 46 # USE_X11 for all dependents so that everything that could use X11 gets the |
47 # define, but anything that doesn't depend on X11 doesn't see it. | 47 # define, but anything that doesn't depend on X11 doesn't see it. |
48 # | 48 # |
49 # For now we define these globally to match the current GYP build. | 49 # For now we define these globally to match the current GYP build. |
50 config("feature_flags") { | 50 config("feature_flags") { |
51 # TODO(brettw) this probably needs to be parameterized. | 51 # Don't use deprecated V8 APIs anywhere. |
52 defines = [ "V8_DEPRECATION_WARNINGS" ] # Don't use deprecated V8 APIs anywhe
re. | 52 defines = [ "V8_DEPRECATION_WARNINGS" ] |
53 if (enable_mdns) { | 53 if (enable_mdns) { |
54 defines += [ "ENABLE_MDNS=1" ] | 54 defines += [ "ENABLE_MDNS=1" ] |
55 } | 55 } |
56 if (enable_notifications) { | 56 if (enable_notifications) { |
57 defines += [ "ENABLE_NOTIFICATIONS" ] | 57 defines += [ "ENABLE_NOTIFICATIONS" ] |
58 } | 58 } |
59 if (enable_pepper_cdms) { | 59 if (enable_pepper_cdms) { |
60 # TODO(brettw) should probably be "=1" | 60 # TODO(brettw) should probably be "=1" |
61 defines += [ "ENABLE_PEPPER_CDMS" ] | 61 defines += [ "ENABLE_PEPPER_CDMS" ] |
62 } | 62 } |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 # http://crbug.com/65151 . | 281 # http://crbug.com/65151 . |
282 # TODO(phajdan.jr): Should we enable this for all of POSIX? | 282 # TODO(phajdan.jr): Should we enable this for all of POSIX? |
283 defines += [ "_GLIBCXX_DEBUG=1" ] | 283 defines += [ "_GLIBCXX_DEBUG=1" ] |
284 } | 284 } |
285 } | 285 } |
286 | 286 |
287 config("release") { | 287 config("release") { |
288 defines = [ "NDEBUG" ] | 288 defines = [ "NDEBUG" ] |
289 | 289 |
290 # Sanitizers. | 290 # Sanitizers. |
291 # TODO(GYP) The GYP build has "release_valgrind_build == 0" for this | |
292 # condition. When Valgrind is set up, we need to do the same here. | |
293 if (is_tsan) { | 291 if (is_tsan) { |
294 defines += [ | 292 defines += [ |
295 "DYNAMIC_ANNOTATIONS_ENABLED=1", | 293 "DYNAMIC_ANNOTATIONS_ENABLED=1", |
296 "WTF_USE_DYNAMIC_ANNOTATIONS=1", | 294 "WTF_USE_DYNAMIC_ANNOTATIONS=1", |
297 ] | 295 ] |
298 } else { | 296 } else { |
299 defines += [ "NVALGRIND" ] | 297 defines += [ "NVALGRIND" ] |
300 if (!is_nacl) { | 298 if (!is_nacl) { |
301 # NaCl always enables dynamic annotations. Currently this value is set to | 299 # NaCl always enables dynamic annotations. Currently this value is set to |
302 # 1 for all .nexes. | 300 # 1 for all .nexes. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 # file doesn't exist, no error will be generated (probably MS tested this | 446 # file doesn't exist, no error will be generated (probably MS tested this |
449 # case but forgot the other one?). To reproduce this error, do a build, | 447 # case but forgot the other one?). To reproduce this error, do a build, |
450 # then delete the precompile.c.obj file, then build again. | 448 # then delete the precompile.c.obj file, then build again. |
451 cflags_c = [ "/wd4206" ] | 449 cflags_c = [ "/wd4206" ] |
452 } else if (is_mac) { | 450 } else if (is_mac) { |
453 precompiled_header = "build/precompile.h" | 451 precompiled_header = "build/precompile.h" |
454 precompiled_source = "//build/precompile.h" | 452 precompiled_source = "//build/precompile.h" |
455 } | 453 } |
456 } | 454 } |
457 } | 455 } |
OLD | NEW |