| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 rspfile = "{{output}}.rsp" | 94 rspfile = "{{output}}.rsp" |
| 95 | 95 |
| 96 # The PDB name needs to be different between C and C++ compiled files. | 96 # The PDB name needs to be different between C and C++ compiled files. |
| 97 pdbname = "{{target_out_dir}}/{{target_output_name}}_cc.pdb" | 97 pdbname = "{{target_out_dir}}/{{target_output_name}}_cc.pdb" |
| 98 command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfil
e /c {{source}} /Fo{{output}} /Fd$pdbname" | 98 command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfil
e /c {{source}} /Fo{{output}} /Fd$pdbname" |
| 99 depsformat = "msvc" | 99 depsformat = "msvc" |
| 100 description = "CXX {{output}}" | 100 description = "CXX {{output}}" |
| 101 outputs = [ | 101 outputs = [ |
| 102 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", | 102 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", |
| 103 ] | 103 ] |
| 104 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" | 104 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}" |
| 105 } | 105 } |
| 106 | 106 |
| 107 tool("rc") { | 107 tool("rc") { |
| 108 command = "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{
include_dirs}} /fo{{output}} {{source}}" | 108 command = "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{
include_dirs}} /fo{{output}} {{source}}" |
| 109 outputs = [ | 109 outputs = [ |
| 110 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.res", | 110 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.res", |
| 111 ] | 111 ] |
| 112 description = "RC {{output}}" | 112 description = "RC {{output}}" |
| 113 } | 113 } |
| 114 | 114 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 tool("copy") { | 194 tool("copy") { |
| 195 command = | 195 command = |
| 196 "$python_path gyp-win-tool recursive-mirror {{source}} {{output}}" | 196 "$python_path gyp-win-tool recursive-mirror {{source}} {{output}}" |
| 197 description = "COPY {{source}} {{output}}" | 197 description = "COPY {{source}} {{output}}" |
| 198 } | 198 } |
| 199 | 199 |
| 200 # When invoking this toolchain not as the default one, these args will be | 200 # 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. | 201 # passed to the build. They are ignored when this is the default toolchain. |
| 202 toolchain_args() { | 202 toolchain_args() { |
| 203 current_cpu = invoker.current_cpu | 203 current_cpu = invoker.current_cpu |
| 204 | |
| 205 # TODO(dpranke): cpu_arch is here for backwards compatibility. | |
| 206 cpu_arch = current_cpu | |
| 207 } | 204 } |
| 208 } | 205 } |
| 209 } | 206 } |
| 210 | 207 |
| 211 # TODO(dpranke): Declare both toolchains all of the time when we | 208 # TODO(dpranke): Declare both toolchains all of the time when we |
| 212 # get it sorted out how we want to support them both in a single build. | 209 # get it sorted out how we want to support them both in a single build. |
| 213 # Right now only one of these can be enabled at a time because the | 210 # Right now only one of these can be enabled at a time because the |
| 214 # runtime libraries get copied to root_build_dir and would collide. | 211 # runtime libraries get copied to root_build_dir and would collide. |
| 215 if (current_cpu == "x86") { | 212 if (current_cpu == "x86") { |
| 216 msvc_toolchain("32") { | 213 msvc_toolchain("32") { |
| 217 environment = "environment.x86" | 214 environment = "environment.x86" |
| 218 | 215 |
| 219 current_cpu = "x86" | 216 current_cpu = "x86" |
| 220 } | 217 } |
| 221 } | 218 } |
| 222 | 219 |
| 223 if (current_cpu == "x64") { | 220 if (current_cpu == "x64") { |
| 224 msvc_toolchain("64") { | 221 msvc_toolchain("64") { |
| 225 environment = "environment.x64" | 222 environment = "environment.x64" |
| 226 | 223 |
| 227 current_cpu = "x64" | 224 current_cpu = "x64" |
| 228 } | 225 } |
| 229 } | 226 } |
| OLD | NEW |