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/crypto.gni") | 8 import("//build/config/crypto.gni") |
8 import("//build/config/features.gni") | 9 import("//build/config/features.gni") |
9 import("//build/config/sanitizers/sanitizers.gni") | 10 import("//build/config/sanitizers/sanitizers.gni") |
10 import("//build/config/ui.gni") | 11 import("//build/config/ui.gni") |
11 import("//build/toolchain/goma.gni") | 12 import("//build/toolchain/goma.gni") |
12 | 13 |
13 declare_args() { | 14 declare_args() { |
14 # When set (the default) enables C++ iterator debugging in debug builds. | 15 # When set (the default) enables C++ iterator debugging in debug builds. |
15 # Iterator debugging is always off in release builds (technically, this flag | 16 # Iterator debugging is always off in release builds (technically, this flag |
16 # affects the "debug" config, which is always available but applied by | 17 # affects the "debug" config, which is always available but applied by |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
401 "CoreFoundation.framework", | 402 "CoreFoundation.framework", |
402 "CoreGraphics.framework", | 403 "CoreGraphics.framework", |
403 "CoreText.framework", | 404 "CoreText.framework", |
404 "Foundation.framework", | 405 "Foundation.framework", |
405 ] | 406 ] |
406 } else if (is_linux) { | 407 } else if (is_linux) { |
407 libs = [ "dl" ] | 408 libs = [ "dl" ] |
408 } | 409 } |
409 } | 410 } |
410 | 411 |
412 # Executable configs ----------------------------------------------------------- | |
413 | |
414 # Windows linker setup for EXEs and DLLs. | |
415 if (is_win) { | |
416 _windows_linker_configs = [ | |
417 "//build/config/win:default_incremental_linking", | |
418 "//build/config/win:sdk_link", | |
419 "//build/config/win:common_linker_setup", | |
420 | |
421 # Default to console-mode apps. Most of our targets are tests and such | |
422 # that shouldn't use the windows subsystem. | |
423 "//build/config/win:console", | |
424 ] | |
425 } | |
426 | |
427 # This config defines the configs applied to all executables. | |
428 config("executable_config") { | |
slan
2015/12/07 16:13:32
Hmmm. Though it appears to be legal, (meaning GN t
Dirk Pranke
2015/12/07 21:03:42
This is valid and recommended in some cases.
See
slan
2015/12/07 21:07:47
Thanks for the tip! bcf@, feel free to ignore my s
| |
429 configs = [] | |
430 | |
431 if (is_win) { | |
432 configs += _windows_linker_configs | |
433 } else if (is_mac) { | |
434 configs += [ | |
435 "//build/config/mac:mac_dynamic_flags", | |
436 "//build/config/mac:mac_executable_flags", | |
437 ] | |
438 } else if (is_linux || is_android || is_chromecast) { | |
slan
2015/12/07 16:13:32
is_chromecast not needed here. The OS flags should
bcf
2015/12/07 21:39:49
Done.
| |
439 configs += [ "//build/config/gcc:executable_ldconfig" ] | |
440 if (is_android) { | |
441 configs += [ "//build/config/android:executable_config" ] | |
442 } else if (is_chromecast) { | |
443 configs += [ "//build/config/chromecast:executable_config" ] | |
444 } | |
445 } | |
446 } | |
447 | |
448 # Shared library configs ------------------------------------------------------- | |
449 | |
450 # This config defines the configs applied to all shared libraries. | |
451 config("shared_library_config") { | |
452 configs = [] | |
453 | |
454 if (is_win) { | |
455 configs += _windows_linker_configs | |
456 } else if (is_mac) { | |
457 configs += [ "//build/config/mac:mac_dynamic_flags" ] | |
458 } else if (is_android) { | |
459 # Strip native JNI exports from shared libraries by default. Binaries that | |
460 # want this can remove this config. | |
461 configs += [ "//build/config/android:hide_native_jni_exports" ] | |
462 } else if (is_chromecast) { | |
463 configs += [ "//build/config/chromecast:shlib_config" ] | |
slan
2015/12/07 16:13:32
nit: Can this be shared_library_config to match th
bcf
2015/12/07 21:39:49
Done.
| |
464 } | |
465 } | |
466 | |
411 # Add this config to your target to enable precompiled headers. | 467 # Add this config to your target to enable precompiled headers. |
412 # | 468 # |
413 # Precompiled headers are done on a per-target basis. If you have just a couple | 469 # Precompiled headers are done on a per-target basis. If you have just a couple |
414 # of files, the time it takes to precompile (~2 seconds) can actually be longer | 470 # of files, the time it takes to precompile (~2 seconds) can actually be longer |
415 # than the time saved. On a Z620, a 100 file target compiles about 2 seconds | 471 # than the time saved. On a Z620, a 100 file target compiles about 2 seconds |
416 # faster with precompiled headers, with greater savings for larger targets. | 472 # faster with precompiled headers, with greater savings for larger targets. |
417 # | 473 # |
418 # Recommend precompiled headers for targets with more than 50 .cc files. | 474 # Recommend precompiled headers for targets with more than 50 .cc files. |
419 config("precompiled_headers") { | 475 config("precompiled_headers") { |
420 if (is_win && !is_official_build && !use_goma) { | 476 if (is_win && !is_official_build && !use_goma) { |
(...skipping 18 matching lines...) Expand all Loading... | |
439 # This error doesn't happen every time. In VS2013, it seems if the .pch | 495 # This error doesn't happen every time. In VS2013, it seems if the .pch |
440 # file doesn't exist, no error will be generated (probably MS tested this | 496 # file doesn't exist, no error will be generated (probably MS tested this |
441 # case but forgot the other one?). To reproduce this error, do a build, | 497 # case but forgot the other one?). To reproduce this error, do a build, |
442 # then delete the precompile.c.obj file, then build again. | 498 # then delete the precompile.c.obj file, then build again. |
443 cflags_c = [ "/wd4206" ] | 499 cflags_c = [ "/wd4206" ] |
444 } else if (is_mac && !is_official_build && !use_goma) { | 500 } else if (is_mac && !is_official_build && !use_goma) { |
445 precompiled_header = "build/precompile.h" | 501 precompiled_header = "build/precompile.h" |
446 precompiled_source = "//build/precompile.h" | 502 precompiled_source = "//build/precompile.h" |
447 } | 503 } |
448 } | 504 } |
OLD | NEW |