Chromium Code Reviews| 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 declare_args() { | 5 declare_args() { |
| 6 # Path to the directory containing the VC binaries for the right | 6 # Path to the directory containing the VC binaries for the right |
| 7 # combination of host and target architectures. Currently only the | 7 # combination of host and target architectures. Currently only the |
| 8 # 64-bit host toolchain is supported, with either 32-bit or 64-bit targets. | 8 # 64-bit host toolchain is supported, with either 32-bit or 64-bit targets. |
| 9 # If vc_bin_dir is not specified on the command line (and it normally | 9 # If vc_bin_dir is not specified on the command line (and it normally |
| 10 # isn't), we will dynamically determine the right value to use at runtime. | 10 # isn't), we will dynamically determine the right value to use at runtime. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 | 37 |
| 38 if (vc_bin_dir == "") { | 38 if (vc_bin_dir == "") { |
| 39 vc_bin_dir = toolchain_data.vc_bin_dir | 39 vc_bin_dir = toolchain_data.vc_bin_dir |
| 40 } | 40 } |
| 41 | 41 |
| 42 # This value will be inherited in the toolchain below. | 42 # This value will be inherited in the toolchain below. |
| 43 concurrent_links = exec_script("../get_concurrent_links.py", [], "value") | 43 concurrent_links = exec_script("../get_concurrent_links.py", [], "value") |
| 44 | 44 |
| 45 # Parameters: | 45 # Parameters: |
| 46 # current_cpu: current_cpu to pass as a build arg | 46 # current_cpu: current_cpu to pass as a build arg |
| 47 # current_os: current_os to pass as a build arg | |
| 47 # environment: File name of environment file. | 48 # environment: File name of environment file. |
| 48 template("msvc_toolchain") { | 49 template("msvc_toolchain") { |
| 49 if (defined(invoker.concurrent_links)) { | 50 if (defined(invoker.concurrent_links)) { |
| 50 concurrent_links = invoker.concurrent_links | 51 concurrent_links = invoker.concurrent_links |
| 51 } | 52 } |
| 52 | 53 |
| 53 env = invoker.environment | 54 env = invoker.environment |
| 54 | 55 |
| 55 if (is_debug) { | 56 if (is_debug) { |
| 56 configuration = "Debug" | 57 configuration = "Debug" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 tool("copy") { | 195 tool("copy") { |
| 195 command = | 196 command = |
| 196 "$python_path gyp-win-tool recursive-mirror {{source}} {{output}}" | 197 "$python_path gyp-win-tool recursive-mirror {{source}} {{output}}" |
| 197 description = "COPY {{source}} {{output}}" | 198 description = "COPY {{source}} {{output}}" |
| 198 } | 199 } |
| 199 | 200 |
| 200 # When invoking this toolchain not as the default one, these args will be | 201 # When invoking this toolchain not as the default one, these args will be |
| 201 # passed to the build. They are ignored when this is the default toolchain. | 202 # passed to the build. They are ignored when this is the default toolchain. |
| 202 toolchain_args() { | 203 toolchain_args() { |
| 203 current_cpu = invoker.current_cpu | 204 current_cpu = invoker.current_cpu |
| 205 current_os = invoker.current_os | |
| 204 } | 206 } |
| 205 } | 207 } |
| 206 } | 208 } |
| 207 | 209 |
| 208 # TODO(dpranke): Declare both toolchains all of the time when we | 210 # TODO(dpranke): Declare both toolchains all of the time when we |
| 209 # get it sorted out how we want to support them both in a single build. | 211 # get it sorted out how we want to support them both in a single build. |
| 210 # Right now only one of these can be enabled at a time because the | 212 # Right now only one of these can be enabled at a time because the |
| 211 # runtime libraries get copied to root_build_dir and would collide. | 213 # runtime libraries get copied to root_build_dir and would collide. |
| 212 if (current_cpu == "x86") { | 214 if (current_cpu == "x86") { |
| 213 msvc_toolchain("32") { | 215 msvc_toolchain("32") { |
| 214 environment = "environment.x86" | 216 environment = "environment.x86" |
| 215 | 217 |
| 216 current_cpu = "x86" | 218 current_cpu = "x86" |
| 219 current_os = "win" | |
| 217 } | 220 } |
| 218 } | 221 } |
| 219 | 222 |
| 220 if (current_cpu == "x64") { | 223 if (current_cpu == "x64") { |
| 221 msvc_toolchain("64") { | 224 msvc_toolchain("64") { |
| 222 environment = "environment.x64" | 225 environment = "environment.x64" |
| 223 | 226 |
| 224 current_cpu = "x64" | 227 current_cpu = "x64" |
| 228 current_os = "win" | |
| 225 } | 229 } |
| 226 } | 230 } |
| 231 | |
| 232 if (current_os != "win") { # WinRT toolchains | |
| 233 if (current_cpu == "x86") { | |
|
brettw
2015/07/22 20:29:20
You can delete the two inner conditions. You can d
| |
| 234 msvc_toolchain("winrt_x86") { | |
| 235 environment = "environment.winrt_x86" | |
| 236 | |
| 237 current_cpu = "x86" | |
| 238 current_os = current_os | |
| 239 } | |
| 240 } | |
| 241 | |
| 242 if (current_cpu == "x64") { | |
| 243 msvc_toolchain("winrt_x64") { | |
| 244 environment = "environment.winrt_x64" | |
| 245 | |
| 246 current_cpu = "x64" | |
| 247 current_os = current_os | |
| 248 } | |
| 249 } | |
| 250 } | |
| OLD | NEW |