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")
8 # Full path to the Windows SDK, not including a backslash at the end.
9 # This value is the default location, override if you have a different
10 # installation location.
11 windows_sdk_path = "C:\Program Files (x86)\Windows Kits\8.0"
14 # Compiler setup for the Windows SDK. Applied to all targets.
16 # The include path is the stuff returned by the script.
17 #include_dirs = msvc_config[0] TODO(brettw) make this work.
22 "_WIN32_WINNT=0x0602",
24 "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS",
26 "NTDDI_VERSION=0x06020000",
29 "WIN32_LEAN_AND_MEAN",
33 # The Windows SDK include directories must be first. They both have a sal.h,
34 # and the SDK one is newer and the SDK uses some newer features from it not
35 # present in the Visual Studio one.
37 "$windows_sdk_path\Include\shared",
38 "$windows_sdk_path\Include\um",
39 "$windows_sdk_path\Include\winrt",
40 "$visual_studio_path\VC\include",
41 "$visual_studio_path\VC\atlmfc\include",
45 # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs.
47 if (cpu_arch == "x64") {
48 ldflags = [ "/MACHINE:X64" ]
50 "$windows_sdk_path\Lib\win8\um\x64",
51 "$visual_studio_path\VC\lib\amd64",
52 "$visual_studio_path\VC\atlmfc\lib\amd64",
57 "/SAFESEH", # Not compatible with x64 so use only for x86.
60 "$windows_sdk_path\Lib\win8\um\x86",
61 "$visual_studio_path\VC\lib",
62 "$visual_studio_path\VC\atlmfc\lib",
65 ldflags += [ "/largeaddressaware" ]
70 # This default linker setup is provided separately from the SDK setup so
71 # targets who want different libraries linked can remove this and specify their
73 config("common_linker_setup") {
81 # ASLR makes debugging with windbg difficult because Chrome.exe and
82 # Chrome.dll share the same base name. As result, windbg will name the
83 # Chrome.dll module like chrome_<base address>, where <base address>
84 # typically changes with each launch. This in turn means that breakpoints in
85 # Chrome.dll don't stick from one launch to the next. For this reason, we
86 # turn ASLR off in debug builds.
88 ldflags += [ "/DYNAMICBASE:NO" ]
90 ldflags += [ "/DYNAMICBASE" ]
122 "/DELAYLOAD:dbghelp.dll",
123 "/DELAYLOAD:dwmapi.dll",
124 "/DELAYLOAD:shell32.dll",
125 "/DELAYLOAD:uxtheme.dll",
129 # Subsystem --------------------------------------------------------------------
132 ldflags = [ "/SUBSYSTEM:CONSOLE" ]
135 ldflags = [ "/SUBSYSTEM:WINDOWS" ]
138 # Incremental linking ----------------------------------------------------------
140 config("incremental_linking") {
141 ldflags = [ "/INCREMENTAL" ]
143 config("no_incremental_linking") {
144 ldflags = [ "/INCREMENTAL:NO" ]