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/clang/clang.gni") | 5 import("//build/config/clang/clang.gni") |
6 import("//build/config/compiler/compiler.gni") | 6 import("//build/config/compiler/compiler.gni") |
7 import("//build/config/sanitizers/sanitizers.gni") | 7 import("//build/config/sanitizers/sanitizers.gni") |
8 import("//build/config/win/visual_studio_version.gni") | 8 import("//build/config/win/visual_studio_version.gni") |
9 import("//build/toolchain/toolchain.gni") | 9 import("//build/toolchain/toolchain.gni") |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 ] | 94 ] |
95 } | 95 } |
96 | 96 |
97 # Clang runtime libraries, such as the sanitizer runtimes, live here. | 97 # Clang runtime libraries, such as the sanitizer runtimes, live here. |
98 lib_dirs = [ "$clang_base_path/lib/clang/$clang_version/lib/windows" ] | 98 lib_dirs = [ "$clang_base_path/lib/clang/$clang_version/lib/windows" ] |
99 } | 99 } |
100 | 100 |
101 # Ensures that the PDB file contains FIXUP information (growing the PDB file | 101 # Ensures that the PDB file contains FIXUP information (growing the PDB file |
102 # by about 5%) but does not otherwise alter the output binary. This | 102 # by about 5%) but does not otherwise alter the output binary. This |
103 # information is used by the Syzygy optimization tool when decomposing the | 103 # information is used by the Syzygy optimization tool when decomposing the |
104 # release image. | 104 # release image. It is enabled for syzyasan builds and opportunistically for |
105 if (!is_debug && !is_win_fastlink && !is_clang) { | 105 # other builds where it is not prohibited (not supported when incrementally |
| 106 # linking, using /debug:fastlink, or building with clang). |
| 107 if (is_syzyasan || |
| 108 (!is_debug && !is_component_build && !is_win_fastlink && !is_clang)) { |
106 ldflags = [ "/PROFILE" ] | 109 ldflags = [ "/PROFILE" ] |
107 } | 110 } |
108 | 111 |
109 # arflags apply only to static_libraries. The normal linker configs are only | 112 # arflags apply only to static_libraries. The normal linker configs are only |
110 # set for executable and shared library targets so arflags must be set | 113 # set for executable and shared library targets so arflags must be set |
111 # elsewhere. Since this is relatively contained, we just apply them in this | 114 # elsewhere. Since this is relatively contained, we just apply them in this |
112 # more general config and they will only have an effect on static libraries. | 115 # more general config and they will only have an effect on static libraries. |
113 arflags = [ | 116 arflags = [ |
114 # "No public symbols found; archive member will be inaccessible." This | 117 # "No public symbols found; archive member will be inaccessible." This |
115 # means that one or more object files in the library can never be | 118 # means that one or more object files in the library can never be |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 } | 308 } |
306 config("windowed") { | 309 config("windowed") { |
307 ldflags = [ "/SUBSYSTEM:WINDOWS$subsystem_version_suffix" ] | 310 ldflags = [ "/SUBSYSTEM:WINDOWS$subsystem_version_suffix" ] |
308 } | 311 } |
309 | 312 |
310 # Incremental linking ---------------------------------------------------------- | 313 # Incremental linking ---------------------------------------------------------- |
311 | 314 |
312 incremental_linking_on_switch = [ "/INCREMENTAL" ] | 315 incremental_linking_on_switch = [ "/INCREMENTAL" ] |
313 incremental_linking_off_switch = [ "/INCREMENTAL:NO" ] | 316 incremental_linking_off_switch = [ "/INCREMENTAL:NO" ] |
314 | 317 |
315 # Disable incremental linking for syzyasan | 318 # Disable incremental linking for syzyasan, enable for debug builds and all |
316 if (is_debug && !is_syzyasan) { | 319 # component builds - any builds where performance is not job one. |
| 320 if ((is_debug || is_component_build) && !is_syzyasan) { |
317 default_incremental_linking_switch = incremental_linking_on_switch | 321 default_incremental_linking_switch = incremental_linking_on_switch |
318 } else { | 322 } else { |
319 default_incremental_linking_switch = incremental_linking_off_switch | 323 default_incremental_linking_switch = incremental_linking_off_switch |
320 } | 324 } |
321 | 325 |
322 # Applies incremental linking or not depending on the current configuration. | 326 # Applies incremental linking or not depending on the current configuration. |
323 config("default_incremental_linking") { | 327 config("default_incremental_linking") { |
324 ldflags = default_incremental_linking_switch | 328 ldflags = default_incremental_linking_switch |
325 } | 329 } |
326 | 330 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 396 |
393 # Internal stuff -------------------------------------------------------------- | 397 # Internal stuff -------------------------------------------------------------- |
394 | 398 |
395 # Config used by the MIDL template to disable warnings. | 399 # Config used by the MIDL template to disable warnings. |
396 config("midl_warnings") { | 400 config("midl_warnings") { |
397 if (is_clang) { | 401 if (is_clang) { |
398 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". | 402 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". |
399 cflags = [ "-Wno-extra-tokens" ] | 403 cflags = [ "-Wno-extra-tokens" ] |
400 } | 404 } |
401 } | 405 } |
OLD | NEW |