| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 declare_args() { | |
| 6 # Full path to the Windows SDK, not including a backslash at the end. | |
| 7 windows_sdk_path = "C:\Program Files (x86)\Windows Kits\8.0" | |
| 8 | |
| 9 # Full path to the Visual Studio installation, not including a backslash | |
| 10 # at the end. | |
| 11 visual_studio_path = "C:\Program Files (x86)\Microsoft Visual Studio 10.0" | |
| 12 } | |
| 13 | |
| 14 # Compiler setup for the Windows SDK. Applied to all targets. | |
| 15 config("sdk") { | |
| 16 # The include path is the stuff returned by the script. | |
| 17 #include_dirs = msvc_config[0] TODO(brettw) make this work. | |
| 18 | |
| 19 defines = [ | |
| 20 "_ATL_NO_OPENGL", | |
| 21 "_SECURE_ATL", | |
| 22 "_WIN32_WINNT=0x0602", | |
| 23 "_WINDOWS", | |
| 24 "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS", | |
| 25 "NOMINMAX", | |
| 26 "NTDDI_VERSION=0x06020000", | |
| 27 "PSAPI_VERSION=1", | |
| 28 "WIN32", | |
| 29 "WIN32_LEAN_AND_MEAN", | |
| 30 "WINVER=0x0602", | |
| 31 ] | |
| 32 | |
| 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. | |
| 36 include_dirs = [ | |
| 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", | |
| 42 ] | |
| 43 } | |
| 44 | |
| 45 # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs. | |
| 46 config("sdk_link") { | |
| 47 # TODO(brettw) 64-bit. | |
| 48 is_64bit = false | |
| 49 | |
| 50 if (is_64bit) { | |
| 51 ldflags = [ "/MACHINE:X64" ] | |
| 52 lib_dirs = [ | |
| 53 "$windows_sdk_path\Lib\win8\um\x64", | |
| 54 "$visual_studio_path\VC\lib\amd64", | |
| 55 "$visual_studio_path\VC\atlmfc\lib\amd64", | |
| 56 ] | |
| 57 } else { | |
| 58 ldflags = [ | |
| 59 "/MACHINE:X86", | |
| 60 "/SAFESEH", # Not compatible with x64 so use only for x86. | |
| 61 ] | |
| 62 lib_dirs = [ | |
| 63 "$windows_sdk_path\Lib\win8\um\x86", | |
| 64 "$visual_studio_path\VC\lib", | |
| 65 "$visual_studio_path\VC\atlmfc\lib", | |
| 66 ] | |
| 67 #if (!is_asan) { TODO(brettw) Address Sanitizer | |
| 68 # ldflags += "/largeaddressaware" | |
| 69 #} | |
| 70 } | |
| 71 } | |
| 72 | |
| 73 # This default linker setup is provided separately from the SDK setup so | |
| 74 # targets who want different libraries linked can remove this and specify their | |
| 75 # own. | |
| 76 config("common_linker_setup") { | |
| 77 ldflags = [ | |
| 78 "/FIXED:NO", | |
| 79 "/ignore:4199", | |
| 80 "/ignore:4221", | |
| 81 "/NXCOMPAT", | |
| 82 ] | |
| 83 | |
| 84 # ASLR makes debugging with windbg difficult because Chrome.exe and | |
| 85 # Chrome.dll share the same base name. As result, windbg will name the | |
| 86 # Chrome.dll module like chrome_<base address>, where <base address> | |
| 87 # typically changes with each launch. This in turn means that breakpoints in | |
| 88 # Chrome.dll don't stick from one launch to the next. For this reason, we | |
| 89 # turn ASLR off in debug builds. | |
| 90 if (is_debug) { | |
| 91 ldflags += "/DYNAMICBASE:NO" | |
| 92 } else { | |
| 93 ldflags += "/DYNAMICBASE" | |
| 94 } | |
| 95 | |
| 96 # Common libraries. | |
| 97 libs = [ | |
| 98 "advapi32.lib", | |
| 99 "comdlg32.lib", | |
| 100 "dbghelp.lib", | |
| 101 "delayimp.lib", | |
| 102 "dnsapi.lib", | |
| 103 "gdi32.lib", | |
| 104 "kernel32.lib", | |
| 105 "msimg32.lib", | |
| 106 "odbc32.lib", | |
| 107 "odbccp32.lib", | |
| 108 "ole32.lib", | |
| 109 "oleaut32.lib", | |
| 110 "psapi.lib", | |
| 111 "shell32.lib", | |
| 112 "shlwapi.lib", | |
| 113 "user32.lib", | |
| 114 "usp10.lib", | |
| 115 "uuid.lib", | |
| 116 "version.lib", | |
| 117 "wininet.lib", | |
| 118 "winmm.lib", | |
| 119 "winspool.lib", | |
| 120 "ws2_32.lib", | |
| 121 ] | |
| 122 | |
| 123 # Delay loaded DLLs. | |
| 124 ldflags += [ | |
| 125 "/DELAYLOAD:dbghelp.dll", | |
| 126 "/DELAYLOAD:dwmapi.dll", | |
| 127 "/DELAYLOAD:shell32.dll", | |
| 128 "/DELAYLOAD:uxtheme.dll", | |
| 129 ] | |
| 130 } | |
| 131 | |
| 132 # Subsystem -------------------------------------------------------------------- | |
| 133 | |
| 134 config("console") { | |
| 135 ldflags = [ "/SUBSYSTEM:CONSOLE" ] | |
| 136 } | |
| 137 config("windowed") { | |
| 138 ldflags = [ "/SUBSYSTEM:WINDOWS" ] | |
| 139 } | |
| 140 | |
| 141 # Incremental linking ---------------------------------------------------------- | |
| 142 | |
| 143 config("incremental_linking") { | |
| 144 ldflags = [ "/INCREMENTAL" ] | |
| 145 } | |
| 146 config("no_incremental_linking") { | |
| 147 ldflags = [ "/INCREMENTAL:NO" ] | |
| 148 } | |
| OLD | NEW |