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
3 # found in the LICENSE file.
5 import("//build/config/win/visual_studio_version.gni")
7 # Compiler setup for the Windows SDK. Applied to all targets.
9 # The include path is the stuff returned by the script.
10 #include_dirs = msvc_config[0] TODO(brettw) make this work.
15 "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS",
16 "NTDDI_VERSION=0x06020000",
21 include_dirs = system_include_dirs
23 if (is_visual_studio_express) {
24 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
25 # Warning 4702 ("Unreachable code") should be re-enabled once Express users
26 # are updated to VS2013 Update 2.
27 cflags = [ "/wd4702" ]
29 # Only supported on non-Express versions.
30 defines += [ "_SECURE_ATL" ]
34 # Sets the default Windows build version. This is separated because some
35 # targets need to manually override it for their compiles.
38 "_WIN32_WINNT=0x0602",
43 # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs.
45 if (cpu_arch == "x64") {
46 ldflags = [ "/MACHINE:X64" ]
48 "$windows_sdk_path\Lib\win8\um\x64",
49 "$visual_studio_path\VC\lib\amd64",
50 "$visual_studio_path\VC\atlmfc\lib\amd64",
52 if (is_visual_studio_express) {
53 lib_dirs += [ "$wdk_path/lib/ATL/amd64" ]
58 "/SAFESEH", # Not compatible with x64 so use only for x86.
61 "$windows_sdk_path\Lib\win8\um\x86",
62 "$visual_studio_path\VC\lib",
63 "$visual_studio_path\VC\atlmfc\lib",
65 if (is_visual_studio_express) {
66 lib_dirs += [ "$wdk_path/lib/ATL/i386" ]
69 ldflags += [ "/largeaddressaware" ]
73 if (is_visual_studio_express) {
74 # Explicitly required when using the ATL with express.
75 libs = [ "atlthunk.lib" ]
77 # ATL 8.0 included in WDK 7.1 makes the linker to generate almost eight
78 # hundred LNK4254 and LNK4078 warnings:
79 # - warning LNK4254: section 'ATL' (50000040) merged into '.rdata'
80 # (40000040) with different attributes
81 # - warning LNK4078: multiple 'ATL' sections found with different
83 ldflags += [ "/ignore:4254", "/ignore:4078" ]
87 # This default linker setup is provided separately from the SDK setup so
88 # targets who want different library configurations can remove this and specify
90 config("common_linker_setup") {
98 # ASLR makes debugging with windbg difficult because Chrome.exe and
99 # Chrome.dll share the same base name. As result, windbg will name the
100 # Chrome.dll module like chrome_<base address>, where <base address>
101 # typically changes with each launch. This in turn means that breakpoints in
102 # Chrome.dll don't stick from one launch to the next. For this reason, we
103 # turn ASLR off in debug builds.
105 ldflags += [ "/DYNAMICBASE:NO" ]
107 ldflags += [ "/DYNAMICBASE" ]
112 "/DELAYLOAD:dbghelp.dll",
113 "/DELAYLOAD:dwmapi.dll",
114 "/DELAYLOAD:shell32.dll",
115 "/DELAYLOAD:uxtheme.dll",
119 # Subsystem --------------------------------------------------------------------
122 ldflags = [ "/SUBSYSTEM:CONSOLE" ]
125 ldflags = [ "/SUBSYSTEM:WINDOWS" ]
128 # Incremental linking ----------------------------------------------------------
130 config("incremental_linking") {
131 ldflags = [ "/INCREMENTAL" ]
133 config("no_incremental_linking") {
134 ldflags = [ "/INCREMENTAL:NO" ]
137 # Character set ----------------------------------------------------------------
139 # Not including this config means "ansi" (8-bit system codepage).
147 # Lean and mean ----------------------------------------------------------------
149 # Some third party code might not compile with WIN32_LEAN_AND_MEAN so we have
150 # to have a separate config for it. Remove this config from your target to
151 # get the "bloaty and accomodating" version of windows.h.
152 config("lean_and_mean") {
154 "WIN32_LEAN_AND_MEAN",
158 # Nominmax --------------------------------------------------------------------
160 # Some third party code defines NOMINMAX before including windows.h, which
161 # then causes warnings when it's been previously defined on the command line.
162 # For such targets, this config can be removed.