| 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. |
| 11 | 11 |
| 12 defines = [ | 12 defines = [ |
| 13 "_ATL_NO_OPENGL", | 13 "_ATL_NO_OPENGL", |
| 14 "_SECURE_ATL", | |
| 15 "_WIN32_WINNT=0x0602", | 14 "_WIN32_WINNT=0x0602", |
| 16 "_WINDOWS", | 15 "_WINDOWS", |
| 17 "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS", | 16 "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS", |
| 18 "NTDDI_VERSION=0x06020000", | 17 "NTDDI_VERSION=0x06020000", |
| 19 "PSAPI_VERSION=1", | 18 "PSAPI_VERSION=1", |
| 20 "WIN32", | 19 "WIN32", |
| 21 "WINVER=0x0602", | 20 "WINVER=0x0602", |
| 22 ] | 21 ] |
| 23 | 22 |
| 24 # The Windows SDK include directories must be first. They both have a sal.h, | 23 # The Windows SDK include directories must be first. They both have a sal.h, |
| 25 # and the SDK one is newer and the SDK uses some newer features from it not | 24 # and the SDK one is newer and the SDK uses some newer features from it not |
| 26 # present in the Visual Studio one. | 25 # present in the Visual Studio one. |
| 27 include_dirs = [ | 26 include_dirs = [ |
| 28 "$windows_sdk_path\Include\shared", | 27 "$windows_sdk_path\Include\shared", |
| 29 "$windows_sdk_path\Include\um", | 28 "$windows_sdk_path\Include\um", |
| 30 "$windows_sdk_path\Include\winrt", | 29 "$windows_sdk_path\Include\winrt", |
| 31 "$visual_studio_path\VC\include", | 30 "$visual_studio_path\VC\include", |
| 32 "$visual_studio_path\VC\atlmfc\include", | 31 "$visual_studio_path\VC\atlmfc\include", |
| 33 ] | 32 ] |
| 33 |
| 34 if (is_visual_studio_express) { |
| 35 include_dirs += [ |
| 36 "$wdk_path/inc/atl71", |
| 37 "$wdk_path/inc/mfc42", |
| 38 ] |
| 39 |
| 40 # https://code.google.com/p/chromium/issues/detail?id=372451#c20 |
| 41 # Warning 4702 ("Unreachable code") should be re-enabled once Express users |
| 42 # are updated to VS2013 Update 2. |
| 43 cflags = [ "/wd4702" ] |
| 44 } else { |
| 45 # Only supported on non-Express versions. |
| 46 defines += [ "_SECURE_ATL" ] |
| 47 } |
| 34 } | 48 } |
| 35 | 49 |
| 36 # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs. | 50 # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs. |
| 37 config("sdk_link") { | 51 config("sdk_link") { |
| 38 if (cpu_arch == "x64") { | 52 if (cpu_arch == "x64") { |
| 39 ldflags = [ "/MACHINE:X64" ] | 53 ldflags = [ "/MACHINE:X64" ] |
| 40 lib_dirs = [ | 54 lib_dirs = [ |
| 41 "$windows_sdk_path\Lib\win8\um\x64", | 55 "$windows_sdk_path\Lib\win8\um\x64", |
| 42 "$visual_studio_path\VC\lib\amd64", | 56 "$visual_studio_path\VC\lib\amd64", |
| 43 "$visual_studio_path\VC\atlmfc\lib\amd64", | 57 "$visual_studio_path\VC\atlmfc\lib\amd64", |
| 44 ] | 58 ] |
| 59 if (is_visual_studio_express) { |
| 60 lib_dirs += [ "$wdk_path/lib/ATL/amd64" ] |
| 61 } |
| 45 } else { | 62 } else { |
| 46 ldflags = [ | 63 ldflags = [ |
| 47 "/MACHINE:X86", | 64 "/MACHINE:X86", |
| 48 "/SAFESEH", # Not compatible with x64 so use only for x86. | 65 "/SAFESEH", # Not compatible with x64 so use only for x86. |
| 49 ] | 66 ] |
| 50 lib_dirs = [ | 67 lib_dirs = [ |
| 51 "$windows_sdk_path\Lib\win8\um\x86", | 68 "$windows_sdk_path\Lib\win8\um\x86", |
| 52 "$visual_studio_path\VC\lib", | 69 "$visual_studio_path\VC\lib", |
| 53 "$visual_studio_path\VC\atlmfc\lib", | 70 "$visual_studio_path\VC\atlmfc\lib", |
| 54 ] | 71 ] |
| 72 if (is_visual_studio_express) { |
| 73 lib_dirs += [ "$wdk_path/lib/ATL/i386" ] |
| 74 } |
| 55 if (!is_asan) { | 75 if (!is_asan) { |
| 56 ldflags += [ "/largeaddressaware" ] | 76 ldflags += [ "/largeaddressaware" ] |
| 57 } | 77 } |
| 58 } | 78 } |
| 79 |
| 80 if (is_visual_studio_express) { |
| 81 # Explicitly required when using the ATL with express. |
| 82 libs = [ "atlthunk.lib" ] |
| 83 |
| 84 # ATL 8.0 included in WDK 7.1 makes the linker to generate almost eight |
| 85 # hundred LNK4254 and LNK4078 warnings: |
| 86 # - warning LNK4254: section 'ATL' (50000040) merged into '.rdata' |
| 87 # (40000040) with different attributes |
| 88 # - warning LNK4078: multiple 'ATL' sections found with different |
| 89 # attributes |
| 90 ldflags += [ "/ignore:4254", "/ignore:4078" ] |
| 91 } |
| 59 } | 92 } |
| 60 | 93 |
| 61 # This default linker setup is provided separately from the SDK setup so | 94 # This default linker setup is provided separately from the SDK setup so |
| 62 # targets who want different library configurations can remove this and specify | 95 # targets who want different library configurations can remove this and specify |
| 63 # their own. | 96 # their own. |
| 64 config("common_linker_setup") { | 97 config("common_linker_setup") { |
| 65 ldflags = [ | 98 ldflags = [ |
| 66 "/FIXED:NO", | 99 "/FIXED:NO", |
| 67 "/ignore:4199", | 100 "/ignore:4199", |
| 68 "/ignore:4221", | 101 "/ignore:4221", |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 166 |
| 134 # Some third party code defines NOMINMAX before including windows.h, which | 167 # 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. | 168 # then causes warnings when it's been previously defined on the command line. |
| 136 # For such targets, this config can be removed. | 169 # For such targets, this config can be removed. |
| 137 | 170 |
| 138 config("nominmax") { | 171 config("nominmax") { |
| 139 defines = [ | 172 defines = [ |
| 140 "NOMINMAX", | 173 "NOMINMAX", |
| 141 ] | 174 ] |
| 142 } | 175 } |
| OLD | NEW |