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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 env = invoker.environment | 78 env = invoker.environment |
79 | 79 |
80 cl = invoker.cl | 80 cl = invoker.cl |
81 | 81 |
82 toolchain(target_name) { | 82 toolchain(target_name) { |
83 # Make these apply to all tools below. | 83 # Make these apply to all tools below. |
84 lib_switch = "" | 84 lib_switch = "" |
85 lib_dir_switch = "/LIBPATH:" | 85 lib_dir_switch = "/LIBPATH:" |
86 | 86 |
| 87 # Object files go in this directory. |
| 88 object_subdir = "{{target_out_dir}}/{{label_name}}" |
| 89 |
87 tool("cc") { | 90 tool("cc") { |
88 rspfile = "{{output}}.rsp" | 91 rspfile = "{{output}}.rsp" |
89 precompiled_header_type = "msvc" | 92 precompiled_header_type = "msvc" |
90 pdbname = "{{target_out_dir}}/{{target_output_name}}_c.pdb" | 93 pdbname = "{{target_out_dir}}/{{target_output_name}}_c.pdb" |
91 command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfil
e /c {{source}} /Fo{{output}} /Fd$pdbname" | 94 command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfil
e /c {{source}} /Fo{{output}} /Fd$pdbname" |
92 depsformat = "msvc" | 95 depsformat = "msvc" |
93 description = "CC {{output}}" | 96 description = "CC {{output}}" |
94 outputs = [ | 97 outputs = [ |
95 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.obj", | 98 "$object_subdir/{{source_name_part}}.obj", |
96 ] | 99 ] |
97 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" | 100 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" |
98 } | 101 } |
99 | 102 |
100 tool("cxx") { | 103 tool("cxx") { |
101 rspfile = "{{output}}.rsp" | 104 rspfile = "{{output}}.rsp" |
102 precompiled_header_type = "msvc" | 105 precompiled_header_type = "msvc" |
103 | 106 |
104 # The PDB name needs to be different between C and C++ compiled files. | 107 # The PDB name needs to be different between C and C++ compiled files. |
105 pdbname = "{{target_out_dir}}/{{target_output_name}}_cc.pdb" | 108 pdbname = "{{target_out_dir}}/{{target_output_name}}_cc.pdb" |
106 command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfil
e /c {{source}} /Fo{{output}} /Fd$pdbname" | 109 command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfil
e /c {{source}} /Fo{{output}} /Fd$pdbname" |
107 depsformat = "msvc" | 110 depsformat = "msvc" |
108 description = "CXX {{output}}" | 111 description = "CXX {{output}}" |
109 outputs = [ | 112 outputs = [ |
110 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.obj", | 113 "$object_subdir/{{source_name_part}}.obj", |
111 ] | 114 ] |
112 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}" | 115 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}" |
113 } | 116 } |
114 | 117 |
115 tool("rc") { | 118 tool("rc") { |
116 command = "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{
include_dirs}} /fo{{output}} {{source}}" | 119 command = "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{
include_dirs}} /fo{{output}} {{source}}" |
117 outputs = [ | 120 outputs = [ |
118 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.res", | 121 "$object_subdir/{{source_name_part}}.res", |
119 ] | 122 ] |
120 description = "RC {{output}}" | 123 description = "RC {{output}}" |
121 } | 124 } |
122 | 125 |
123 tool("asm") { | 126 tool("asm") { |
124 if (current_cpu == "x64") { | 127 if (current_cpu == "x64") { |
125 ml = "ml64.exe" | 128 ml = "ml64.exe" |
126 } else { | 129 } else { |
127 ml = "ml.exe" | 130 ml = "ml.exe" |
128 } | 131 } |
129 command = "$python_path gyp-win-tool asm-wrapper $env $ml {{defines}} {{in
clude_dirs}} {{asmflags}} /c /Fo{{output}} {{source}}" | 132 command = "$python_path gyp-win-tool asm-wrapper $env $ml {{defines}} {{in
clude_dirs}} {{asmflags}} /c /Fo{{output}} {{source}}" |
130 description = "ASM {{output}}" | 133 description = "ASM {{output}}" |
131 outputs = [ | 134 outputs = [ |
132 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.obj", | 135 "$object_subdir/{{source_name_part}}.obj", |
133 ] | 136 ] |
134 } | 137 } |
135 | 138 |
136 tool("alink") { | 139 tool("alink") { |
137 rspfile = "{{output}}.rsp" | 140 rspfile = "{{output}}.rsp" |
138 command = "$python_path gyp-win-tool link-wrapper $env False lib.exe /nolo
go /ignore:4221 /OUT:{{output}} @$rspfile" | 141 command = "$python_path gyp-win-tool link-wrapper $env False lib.exe /nolo
go /ignore:4221 /OUT:{{output}} @$rspfile" |
139 description = "LIB {{output}}" | 142 description = "LIB {{output}}" |
140 outputs = [ | 143 outputs = [ |
141 # Ignore {{output_extension}} and always use .lib, there's no reason to | 144 # Ignore {{output_extension}} and always use .lib, there's no reason to |
142 # allow targets to override this extension on Windows. | 145 # allow targets to override this extension on Windows. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 } | 298 } |
296 | 299 |
297 msvc_toolchain("winrt_x64") { | 300 msvc_toolchain("winrt_x64") { |
298 environment = "environment.winrt_x64" | 301 environment = "environment.winrt_x64" |
299 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" | 302 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" |
300 is_clang = false | 303 is_clang = false |
301 | 304 |
302 current_cpu = "x64" | 305 current_cpu = "x64" |
303 current_os = current_os | 306 current_os = current_os |
304 } | 307 } |
OLD | NEW |