| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 # cmd.exe doesn't understand ANSI escape codes by default, | 79 # cmd.exe doesn't understand ANSI escape codes by default, |
| 80 # so only enable them if something emulating them is around. | 80 # so only enable them if something emulating them is around. |
| 81 "-fansi-escape-codes", | 81 "-fansi-escape-codes", |
| 82 ] | 82 ] |
| 83 } | 83 } |
| 84 | 84 |
| 85 # Clang runtime libraries, such as the sanitizer runtimes, live here. | 85 # Clang runtime libraries, such as the sanitizer runtimes, live here. |
| 86 lib_dirs = [ "$clang_base_path/lib/clang/$clang_version/lib/windows" ] | 86 lib_dirs = [ "$clang_base_path/lib/clang/$clang_version/lib/windows" ] |
| 87 } | 87 } |
| 88 | 88 |
| 89 # Ensures that the PDB file contains FIXUP information (growing the PDB file | 89 # /PROFILE ensures that the PDB file contains FIXUP information (growing the |
| 90 # by about 5%) but does not otherwise alter the output binary. This | 90 # PDB file by about 5%) but does not otherwise alter the output binary. This |
| 91 # information is used by the Syzygy optimization tool when decomposing the | 91 # information is used by the Syzygy optimization tool when decomposing the |
| 92 # release image. It is enabled for syzyasan builds and opportunistically for | 92 # release image. It is enabled for syzyasan builds and opportunistically for |
| 93 # other builds where it is not prohibited (not supported when incrementally | 93 # other builds where it is not prohibited (not supported when incrementally |
| 94 # linking, using /debug:fastlink, or building with clang). | 94 # linking, using /debug:fastlink, or building with clang). |
| 95 if (is_syzyasan || | 95 if (is_syzyasan) { |
| 96 (!is_debug && !is_component_build && !is_win_fastlink && !is_clang)) { | 96 assert(!is_win_fastlink) |
| 97 ldflags = [ "/PROFILE" ] | 97 ldflags = [ "/PROFILE" ] |
| 98 } else { |
| 99 if (!is_debug && !is_component_build && !is_clang) { |
| 100 if (is_win_fastlink) { |
| 101 # /PROFILE implies the following linker flags. Therefore if we are |
| 102 # skipping /PROFILE because it is incompatible with /DEBUG:FASTLINK |
| 103 # we should explicitly add these flags in order to avoid unintended |
| 104 # consequences such as larger binaries. |
| 105 ldflags = [ |
| 106 "/OPT:REF", |
| 107 "/OPT:ICF", |
| 108 "/INCREMENTAL:NO", |
| 109 "/FIXED:NO", |
| 110 ] |
| 111 } else { |
| 112 ldflags = [ "/PROFILE" ] |
| 113 } |
| 114 } |
| 98 } | 115 } |
| 99 | 116 |
| 100 # arflags apply only to static_libraries. The normal linker configs are only | 117 # arflags apply only to static_libraries. The normal linker configs are only |
| 101 # set for executable and shared library targets so arflags must be set | 118 # set for executable and shared library targets so arflags must be set |
| 102 # elsewhere. Since this is relatively contained, we just apply them in this | 119 # elsewhere. Since this is relatively contained, we just apply them in this |
| 103 # more general config and they will only have an effect on static libraries. | 120 # more general config and they will only have an effect on static libraries. |
| 104 arflags = [ | 121 arflags = [ |
| 105 # "No public symbols found; archive member will be inaccessible." This | 122 # "No public symbols found; archive member will be inaccessible." This |
| 106 # means that one or more object files in the library can never be | 123 # means that one or more object files in the library can never be |
| 107 # pulled in to targets that link to this library. It's just a warning that | 124 # pulled in to targets that link to this library. It's just a warning that |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 | 423 |
| 407 # Internal stuff -------------------------------------------------------------- | 424 # Internal stuff -------------------------------------------------------------- |
| 408 | 425 |
| 409 # Config used by the MIDL template to disable warnings. | 426 # Config used by the MIDL template to disable warnings. |
| 410 config("midl_warnings") { | 427 config("midl_warnings") { |
| 411 if (is_clang) { | 428 if (is_clang) { |
| 412 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". | 429 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". |
| 413 cflags = [ "-Wno-extra-tokens" ] | 430 cflags = [ "-Wno-extra-tokens" ] |
| 414 } | 431 } |
| 415 } | 432 } |
| OLD | NEW |