| 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/win/visual_studio_version.gni") | 5 import("//build/config/win/visual_studio_version.gni") |
| 6 | 6 |
| 7 # Compiler setup for the Windows SDK. Applied to all targets. | 7 # Compiler setup for the Windows SDK. Applied to all targets. |
| 8 config("sdk") { | 8 config("sdk") { |
| 9 # The include path is the stuff returned by the script. | 9 # The include path is the stuff returned by the script. |
| 10 #include_dirs = msvc_config[0] TODO(brettw) make this work. | 10 #include_dirs = msvc_config[0] TODO(brettw) make this work. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 # This default linker setup is provided separately from the SDK setup so | 60 # This default linker setup is provided separately from the SDK setup so |
| 61 # targets who want different library configurations can remove this and specify | 61 # targets who want different library configurations can remove this and specify |
| 62 # their own. | 62 # their own. |
| 63 config("common_linker_setup") { | 63 config("common_linker_setup") { |
| 64 ldflags = [ | 64 ldflags = [ |
| 65 "/FIXED:NO", | 65 "/FIXED:NO", |
| 66 "/ignore:4199", | 66 "/ignore:4199", |
| 67 "/ignore:4221", | 67 "/ignore:4221", |
| 68 "/ignore:4197", # Disable multiple Dart_True export warning. |
| 68 "/NXCOMPAT", | 69 "/NXCOMPAT", |
| 69 | 70 |
| 70 # Suggested by Microsoft Devrel to avoid | 71 # Suggested by Microsoft Devrel to avoid |
| 71 # LINK : fatal error LNK1248: image size (80000000) | 72 # LINK : fatal error LNK1248: image size (80000000) |
| 72 # exceeds maximum allowable size (80000000) | 73 # exceeds maximum allowable size (80000000) |
| 73 # which started happening more regularly after VS2013 Update 4. | 74 # which started happening more regularly after VS2013 Update 4. |
| 74 "/maxilksize:2147483647", | 75 "/maxilksize:2147483647", |
| 75 ] | 76 ] |
| 76 | 77 |
| 77 # ASLR makes debugging with windbg difficult because Chrome.exe and | 78 # ASLR makes debugging with windbg difficult because Chrome.exe and |
| 78 # Chrome.dll share the same base name. As result, windbg will name the | 79 # Chrome.dll share the same base name. As result, windbg will name the |
| 79 # Chrome.dll module like chrome_<base address>, where <base address> | 80 # Chrome.dll module like chrome_<base address>, where <base address> |
| 80 # typically changes with each launch. This in turn means that breakpoints in | 81 # typically changes with each launch. This in turn means that breakpoints in |
| 81 # Chrome.dll don't stick from one launch to the next. For this reason, we | 82 # Chrome.dll don't stick from one launch to the next. For this reason, we |
| 82 # turn ASLR off in debug builds. | 83 # turn ASLR off in debug builds. |
| 83 if (is_debug) { | 84 if (is_debug) { |
| 84 ldflags += [ "/DYNAMICBASE:NO" ] | 85 ldflags += [ "/DYNAMICBASE:NO" ] |
| 85 } else { | 86 } else { |
| 86 ldflags += [ "/DYNAMICBASE" ] | 87 ldflags += [ "/DYNAMICBASE" ] |
| 87 } | 88 } |
| 88 | |
| 89 # Delay loaded DLLs. | |
| 90 ldflags += [ | |
| 91 "/DELAYLOAD:dbghelp.dll", | |
| 92 "/DELAYLOAD:dwmapi.dll", | |
| 93 "/DELAYLOAD:shell32.dll", | |
| 94 "/DELAYLOAD:uxtheme.dll", | |
| 95 ] | |
| 96 } | 89 } |
| 97 | 90 |
| 98 # Subsystem -------------------------------------------------------------------- | 91 # Subsystem ------------------------------------------------------------------- |
| 99 | 92 |
| 100 # This is appended to the subsystem to specify a minimum version. | 93 # This is appended to the subsystem to specify a minimum version. |
| 101 if (current_cpu == "x64") { | 94 if (current_cpu == "x64") { |
| 102 # The number after the comma is the minimum required OS version. | 95 # The number after the comma is the minimum required OS version. |
| 103 # 5.02 = Windows Server 2003. | 96 # 5.02 = Windows Server 2003. |
| 104 subsystem_version_suffix = ",5.02" | 97 subsystem_version_suffix = ",5.02" |
| 105 } else { | 98 } else { |
| 106 # 5.01 = Windows XP. | 99 # 5.01 = Windows XP. |
| 107 subsystem_version_suffix = ",5.01" | 100 subsystem_version_suffix = ",5.01" |
| 108 } | 101 } |
| 109 | 102 |
| 110 config("console") { | 103 config("console") { |
| 111 ldflags = [ "/SUBSYSTEM:CONSOLE$subsystem_version_suffix" ] | 104 ldflags = [ "/SUBSYSTEM:CONSOLE$subsystem_version_suffix" ] |
| 112 } | 105 } |
| 113 config("windowed") { | 106 config("windowed") { |
| 114 ldflags = [ "/SUBSYSTEM:WINDOWS$subsystem_version_suffix" ] | 107 ldflags = [ "/SUBSYSTEM:WINDOWS$subsystem_version_suffix" ] |
| 115 } | 108 } |
| 116 | 109 |
| 117 # Incremental linking ---------------------------------------------------------- | 110 # Incremental linking --------------------------------------------------------- |
| 118 | 111 |
| 119 incremental_linking_on_switch = [ "/INCREMENTAL" ] | 112 incremental_linking_on_switch = [ "/INCREMENTAL" ] |
| 120 incremental_linking_off_switch = [ "/INCREMENTAL:NO" ] | 113 incremental_linking_off_switch = [ "/INCREMENTAL:NO" ] |
| 121 if (is_debug) { | 114 if (is_debug) { |
| 122 default_incremental_linking_switch = incremental_linking_on_switch | 115 default_incremental_linking_switch = incremental_linking_on_switch |
| 123 } else { | 116 } else { |
| 124 default_incremental_linking_switch = incremental_linking_off_switch | 117 default_incremental_linking_switch = incremental_linking_off_switch |
| 125 } | 118 } |
| 126 | 119 |
| 127 # Applies incremental linking or not depending on the current configuration. | 120 # Applies incremental linking or not depending on the current configuration. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 144 if (current_cpu == "x86" || !is_component_build) { | 137 if (current_cpu == "x86" || !is_component_build) { |
| 145 # When symbols are on, things get so large that the tools fail due to the | 138 # When symbols are on, things get so large that the tools fail due to the |
| 146 # size of the .ilk files. | 139 # size of the .ilk files. |
| 147 ldflags = incremental_linking_off_switch | 140 ldflags = incremental_linking_off_switch |
| 148 } else { | 141 } else { |
| 149 # Otherwise just do the default incremental linking for this build type. | 142 # Otherwise just do the default incremental linking for this build type. |
| 150 ldflags = default_incremental_linking_switch | 143 ldflags = default_incremental_linking_switch |
| 151 } | 144 } |
| 152 } | 145 } |
| 153 | 146 |
| 154 # Character set ---------------------------------------------------------------- | 147 # Character set --------------------------------------------------------------- |
| 155 | 148 |
| 156 # Not including this config means "ansi" (8-bit system codepage). | 149 # Not including this config means "ansi" (8-bit system codepage). |
| 157 config("unicode") { | 150 config("unicode") { |
| 158 defines = [ | 151 defines = [ |
| 159 "_UNICODE", | 152 "_UNICODE", |
| 160 "UNICODE", | 153 "UNICODE", |
| 161 ] | 154 ] |
| 162 } | 155 } |
| 163 | 156 |
| 164 # Lean and mean ---------------------------------------------------------------- | 157 # Lean and mean --------------------------------------------------------------- |
| 165 | 158 |
| 166 # Some third party code might not compile with WIN32_LEAN_AND_MEAN so we have | 159 # Some third party code might not compile with WIN32_LEAN_AND_MEAN so we have |
| 167 # to have a separate config for it. Remove this config from your target to | 160 # to have a separate config for it. Remove this config from your target to |
| 168 # get the "bloaty and accomodating" version of windows.h. | 161 # get the "bloaty and accomodating" version of windows.h. |
| 169 config("lean_and_mean") { | 162 config("lean_and_mean") { |
| 170 defines = [ "WIN32_LEAN_AND_MEAN" ] | 163 defines = [ "WIN32_LEAN_AND_MEAN" ] |
| 171 } | 164 } |
| 172 | 165 |
| 173 # Nominmax -------------------------------------------------------------------- | 166 # Nominmax -------------------------------------------------------------------- |
| 174 | 167 |
| 175 # Some third party code defines NOMINMAX before including windows.h, which | 168 # Some third party code defines NOMINMAX before including windows.h, which |
| 176 # then causes warnings when it's been previously defined on the command line. | 169 # then causes warnings when it's been previously defined on the command line. |
| 177 # For such targets, this config can be removed. | 170 # For such targets, this config can be removed. |
| 178 | 171 |
| 179 config("nominmax") { | 172 config("nominmax") { |
| 180 defines = [ "NOMINMAX" ] | 173 defines = [ "NOMINMAX" ] |
| 181 } | 174 } |
| OLD | NEW |