| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" | 74 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" |
| 75 | 75 |
| 76 toolchain(target_name) { | 76 toolchain(target_name) { |
| 77 # Make these apply to all tools below. | 77 # Make these apply to all tools below. |
| 78 lib_switch = "" | 78 lib_switch = "" |
| 79 lib_dir_switch = "/LIBPATH:" | 79 lib_dir_switch = "/LIBPATH:" |
| 80 | 80 |
| 81 tool("cc") { | 81 tool("cc") { |
| 82 rspfile = "{{output}}.rsp" | 82 rspfile = "{{output}}.rsp" |
| 83 pdbname = "{{target_out_dir}}/{{target_output_name}}_c.pdb" | 83 pdbname = "{{target_out_dir}}/{{target_output_name}}_c.pdb" |
| 84 command = | 84 command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfil
e /c {{source}} /Fo{{output}} /Fd$pdbname" |
| 85 "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfile /c {
{source}} /Fo{{output}} /Fd$pdbname" | |
| 86 depsformat = "msvc" | 85 depsformat = "msvc" |
| 87 description = "CC {{output}}" | 86 description = "CC {{output}}" |
| 88 outputs = | 87 outputs = [ |
| 89 [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj"
] | 88 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", |
| 89 ] |
| 90 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" | 90 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" |
| 91 } | 91 } |
| 92 | 92 |
| 93 tool("cxx") { | 93 tool("cxx") { |
| 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 = | 98 command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfil
e /c {{source}} /Fo{{output}} /Fd$pdbname" |
| 99 "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfile /c {
{source}} /Fo{{output}} /Fd$pdbname" | |
| 100 depsformat = "msvc" | 99 depsformat = "msvc" |
| 101 description = "CXX {{output}}" | 100 description = "CXX {{output}}" |
| 102 outputs = | 101 outputs = [ |
| 103 [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj"
] | 102 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", |
| 103 ] |
| 104 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" | 104 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" |
| 105 } | 105 } |
| 106 | 106 |
| 107 tool("rc") { | 107 tool("rc") { |
| 108 command = | 108 command = "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{
include_dirs}} /fo{{output}} {{source}}" |
| 109 "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{includ
e_dirs}} /fo{{output}} {{source}}" | 109 outputs = [ |
| 110 outputs = | 110 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.res", |
| 111 [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.res"
] | 111 ] |
| 112 description = "RC {{output}}" | 112 description = "RC {{output}}" |
| 113 } | 113 } |
| 114 | 114 |
| 115 tool("asm") { | 115 tool("asm") { |
| 116 # TODO(brettw): "/safeseh" assembler argument is hardcoded here. Extract | 116 # TODO(brettw): "/safeseh" assembler argument is hardcoded here. Extract |
| 117 # assembler flags to a variable like cflags. crbug.com/418613 | 117 # assembler flags to a variable like cflags. crbug.com/418613 |
| 118 command = | 118 command = "$python_path gyp-win-tool asm-wrapper $env ml.exe {{defines}} {
{include_dirs}} /safeseh /c /Fo {{output}} {{source}}" |
| 119 "$python_path gyp-win-tool asm-wrapper $env ml.exe {{defines}} {{inclu
de_dirs}} /safeseh /c /Fo {{output}} {{source}}" | |
| 120 description = "ASM {{output}}" | 119 description = "ASM {{output}}" |
| 121 outputs = | 120 outputs = [ |
| 122 [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj"
] | 121 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", |
| 122 ] |
| 123 } | 123 } |
| 124 | 124 |
| 125 tool("alink") { | 125 tool("alink") { |
| 126 rspfile = "{{output}}.rsp" | 126 rspfile = "{{output}}.rsp" |
| 127 command = | 127 command = "$python_path gyp-win-tool link-wrapper $env False lib.exe /nolo
go /ignore:4221 /OUT:{{output}} @$rspfile" |
| 128 "$python_path gyp-win-tool link-wrapper $env False lib.exe /nologo /ig
nore:4221 /OUT:{{output}} @$rspfile" | |
| 129 description = "LIB {{output}}" | 128 description = "LIB {{output}}" |
| 130 outputs = [ | 129 outputs = [ |
| 131 # Ignore {{output_extension}} and always use .lib, there's no reason to | 130 # Ignore {{output_extension}} and always use .lib, there's no reason to |
| 132 # allow targets to override this extension on Windows. | 131 # allow targets to override this extension on Windows. |
| 133 "{{target_out_dir}}/{{target_output_name}}.lib", | 132 "{{target_out_dir}}/{{target_output_name}}.lib", |
| 134 ] | 133 ] |
| 135 default_output_extension = ".lib" | 134 default_output_extension = ".lib" |
| 136 | 135 |
| 137 # The use of inputs_newline is to work around a fixed per-line buffer | 136 # The use of inputs_newline is to work around a fixed per-line buffer |
| 138 # size in the linker. | 137 # size in the linker. |
| 139 rspfile_content = "{{inputs_newline}}" | 138 rspfile_content = "{{inputs_newline}}" |
| 140 } | 139 } |
| 141 | 140 |
| 142 tool("solink") { | 141 tool("solink") { |
| 143 dllname = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" #
e.g. foo.dll | 142 dllname = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" #
e.g. foo.dll |
| 144 libname = | 143 libname = |
| 145 "{{root_out_dir}}/{{target_output_name}}{{output_extension}}.lib" # e
.g. foo.dll.lib | 144 "{{root_out_dir}}/{{target_output_name}}{{output_extension}}.lib" # e
.g. foo.dll.lib |
| 146 rspfile = "${dllname}.rsp" | 145 rspfile = "${dllname}.rsp" |
| 147 | 146 |
| 148 link_command = | 147 link_command = "$python_path gyp-win-tool link-wrapper $env False link.exe
/nologo /IMPLIB:$libname /DLL /OUT:$dllname /PDB:${dllname}.pdb @$rspfile" |
| 149 "$python_path gyp-win-tool link-wrapper $env False link.exe /nologo /I
MPLIB:$libname /DLL /OUT:$dllname /PDB:${dllname}.pdb @$rspfile" | |
| 150 | 148 |
| 151 # TODO(brettw) support manifests | 149 # TODO(brettw) support manifests |
| 152 #manifest_command = "$python_path gyp-win-tool manifest-wrapper $env mt.ex
e -nologo -manifest $manifests -out:${dllname}.manifest" | 150 #manifest_command = "$python_path gyp-win-tool manifest-wrapper $env mt.ex
e -nologo -manifest $manifests -out:${dllname}.manifest" |
| 153 #command = "cmd /c $link_command && $manifest_command" | 151 #command = "cmd /c $link_command && $manifest_command" |
| 154 command = link_command | 152 command = link_command |
| 155 | 153 |
| 156 default_output_extension = ".dll" | 154 default_output_extension = ".dll" |
| 157 description = "LINK(DLL) {{output}}" | 155 description = "LINK(DLL) {{output}}" |
| 158 outputs = [ | 156 outputs = [ |
| 159 dllname, | 157 dllname, |
| 160 libname, | 158 libname, |
| 161 ] | 159 ] |
| 162 link_output = libname | 160 link_output = libname |
| 163 depend_output = libname | 161 depend_output = libname |
| 164 | 162 |
| 165 # The use of inputs_newline is to work around a fixed per-line buffer | 163 # The use of inputs_newline is to work around a fixed per-line buffer |
| 166 # size in the linker. | 164 # size in the linker. |
| 167 rspfile_content = "{{libs}} {{solibs}} {{inputs_newline}} {{ldflags}}" | 165 rspfile_content = "{{libs}} {{solibs}} {{inputs_newline}} {{ldflags}}" |
| 168 } | 166 } |
| 169 | 167 |
| 170 tool("link") { | 168 tool("link") { |
| 171 rspfile = "{{output}}.rsp" | 169 rspfile = "{{output}}.rsp" |
| 172 | 170 |
| 173 link_command = | 171 link_command = "$python_path gyp-win-tool link-wrapper $env False link.exe
/nologo /OUT:{{output}} /PDB:{{output}}.pdb @$rspfile" |
| 174 "$python_path gyp-win-tool link-wrapper $env False link.exe /nologo /O
UT:{{output}} /PDB:{{output}}.pdb @$rspfile" | |
| 175 | 172 |
| 176 # TODO(brettw) support manifests | 173 # TODO(brettw) support manifests |
| 177 #manifest_command = "$python_path gyp-win-tool manifest-wrapper $env mt.ex
e -nologo -manifest $manifests -out:{{output}}.manifest" | 174 #manifest_command = "$python_path gyp-win-tool manifest-wrapper $env mt.ex
e -nologo -manifest $manifests -out:{{output}}.manifest" |
| 178 #command = "cmd /c $link_command && $manifest_command" | 175 #command = "cmd /c $link_command && $manifest_command" |
| 179 command = link_command | 176 command = link_command |
| 180 | 177 |
| 181 default_output_extension = ".exe" | 178 default_output_extension = ".exe" |
| 182 description = "LINK {{output}}" | 179 description = "LINK {{output}}" |
| 183 outputs = | 180 outputs = [ |
| 184 [ "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" ] | 181 "{{root_out_dir}}/{{target_output_name}}{{output_extension}}", |
| 182 ] |
| 185 | 183 |
| 186 # The use of inputs_newline is to work around a fixed per-line buffer | 184 # The use of inputs_newline is to work around a fixed per-line buffer |
| 187 # size in the linker. | 185 # size in the linker. |
| 188 rspfile_content = "{{inputs_newline}} {{libs}} {{solibs}} {{ldflags}}" | 186 rspfile_content = "{{inputs_newline}} {{libs}} {{solibs}} {{ldflags}}" |
| 189 } | 187 } |
| 190 | 188 |
| 191 tool("stamp") { | 189 tool("stamp") { |
| 192 command = "$python_path gyp-win-tool stamp {{output}}" | 190 command = "$python_path gyp-win-tool stamp {{output}}" |
| 193 description = "STAMP {{output}}" | 191 description = "STAMP {{output}}" |
| 194 } | 192 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 217 cpu_arch = "x86" | 215 cpu_arch = "x86" |
| 218 } | 216 } |
| 219 } | 217 } |
| 220 | 218 |
| 221 if (cpu_arch == "x64") { | 219 if (cpu_arch == "x64") { |
| 222 msvc_toolchain("64") { | 220 msvc_toolchain("64") { |
| 223 environment = "environment.x64" | 221 environment = "environment.x64" |
| 224 cpu_arch = "x64" | 222 cpu_arch = "x64" |
| 225 } | 223 } |
| 226 } | 224 } |
| OLD | NEW |