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=0x06030000",
23 # Sets the default Windows build version. This is separated because some
24 # targets need to manually override it for their compiles.
27 "_WIN32_WINNT=0x0603",
32 # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs.
34 if (current_cpu == "x64") {
35 ldflags = [ "/MACHINE:X64" ]
37 "$windows_sdk_path\Lib\winv6.3\um\x64",
38 "$visual_studio_path\VC\lib\amd64",
39 "$visual_studio_path\VC\atlmfc\lib\amd64",
44 "/SAFESEH", # Not compatible with x64 so use only for x86.
47 "$windows_sdk_path\Lib\winv6.3\um\x86",
48 "$visual_studio_path\VC\lib",
49 "$visual_studio_path\VC\atlmfc\lib",
52 ldflags += [ "/largeaddressaware" ]
57 # This default linker setup is provided separately from the SDK setup so
58 # targets who want different library configurations can remove this and specify
60 config("common_linker_setup") {
67 # Suggested by Microsoft Devrel to avoid
68 # LINK : fatal error LNK1248: image size (80000000)
69 # exceeds maximum allowable size (80000000)
70 # which started happening more regularly after VS2013 Update 4.
71 "/maxilksize:2147483647",
74 # ASLR makes debugging with windbg difficult because Chrome.exe and
75 # Chrome.dll share the same base name. As result, windbg will name the
76 # Chrome.dll module like chrome_<base address>, where <base address>
77 # typically changes with each launch. This in turn means that breakpoints in
78 # Chrome.dll don't stick from one launch to the next. For this reason, we
79 # turn ASLR off in debug builds.
81 ldflags += [ "/DYNAMICBASE:NO" ]
83 ldflags += [ "/DYNAMICBASE" ]
88 "/DELAYLOAD:dbghelp.dll",
89 "/DELAYLOAD:dwmapi.dll",
90 "/DELAYLOAD:shell32.dll",
91 "/DELAYLOAD:uxtheme.dll",
95 # Subsystem --------------------------------------------------------------------
98 ldflags = [ "/SUBSYSTEM:CONSOLE" ]
101 ldflags = [ "/SUBSYSTEM:WINDOWS" ]
104 # Incremental linking ----------------------------------------------------------
106 config("incremental_linking") {
107 ldflags = [ "/INCREMENTAL" ]
109 config("no_incremental_linking") {
110 ldflags = [ "/INCREMENTAL:NO" ]
113 # Character set ----------------------------------------------------------------
115 # Not including this config means "ansi" (8-bit system codepage).
123 # Lean and mean ----------------------------------------------------------------
125 # Some third party code might not compile with WIN32_LEAN_AND_MEAN so we have
126 # to have a separate config for it. Remove this config from your target to
127 # get the "bloaty and accomodating" version of windows.h.
128 config("lean_and_mean") {
129 defines = [ "WIN32_LEAN_AND_MEAN" ]
132 # Nominmax --------------------------------------------------------------------
134 # Some third party code defines NOMINMAX before including windows.h, which
135 # then causes warnings when it's been previously defined on the command line.
136 # For such targets, this config can be removed.
139 defines = [ "NOMINMAX" ]