| 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 import("//build/toolchain/goma.gni") | 6 import("//build/toolchain/goma.gni") |
| 7 | 7 |
| 8 # Should only be running on Windows. | 8 # Should only be running on Windows. |
| 9 assert(is_win) | 9 assert(is_win) |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 if (is_debug) { | 39 if (is_debug) { |
| 40 configuration = "Debug" | 40 configuration = "Debug" |
| 41 } else { | 41 } else { |
| 42 configuration = "Release" | 42 configuration = "Release" |
| 43 } | 43 } |
| 44 exec_script("../../vs_toolchain.py", ["copy_dlls", | 44 exec_script("../../vs_toolchain.py", ["copy_dlls", |
| 45 rebase_path(root_build_dir), | 45 rebase_path(root_build_dir), |
| 46 configuration, | 46 configuration, |
| 47 invoker.cpu_arch]) | 47 invoker.cpu_arch]) |
| 48 | 48 |
| 49 if (use_goma) { |
| 50 goma_prefix = "$goma_dir/gomacc.exe " |
| 51 } else { |
| 52 goma_prefix = "" |
| 53 } |
| 54 |
| 55 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" |
| 56 |
| 49 toolchain(target_name) { | 57 toolchain(target_name) { |
| 50 # Make these apply to all tools below. | 58 # Make these apply to all tools below. |
| 51 lib_switch = "" | 59 lib_switch = "" |
| 52 lib_dir_switch="/LIBPATH:" | 60 lib_dir_switch="/LIBPATH:" |
| 53 | 61 |
| 54 tool("cc") { | 62 tool("cc") { |
| 55 rspfile = "{{output}}.rsp" | 63 rspfile = "{{output}}.rsp" |
| 56 pdbname = "{{target_out_dir}}/{{target_output_name}}_c.pdb" | 64 pdbname = "{{target_out_dir}}/{{target_output_name}}_c.pdb" |
| 57 command = "ninja -t msvc -e $env -- cl.exe /nologo /showIncludes /FC @$rsp
file /c {{source}} /Fo{{output}} /Fd$pdbname" | 65 command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfil
e /c {{source}} /Fo{{output}} /Fd$pdbname" |
| 58 depsformat = "msvc" | 66 depsformat = "msvc" |
| 59 description = "CC {{output}}" | 67 description = "CC {{output}}" |
| 60 outputs = [ | 68 outputs = [ |
| 61 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", | 69 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", |
| 62 ] | 70 ] |
| 63 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" | 71 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" |
| 64 } | 72 } |
| 65 | 73 |
| 66 tool("cxx") { | 74 tool("cxx") { |
| 67 rspfile = "{{output}}.rsp" | 75 rspfile = "{{output}}.rsp" |
| 68 # The PDB name needs to be different between C and C++ compiled files. | 76 # The PDB name needs to be different between C and C++ compiled files. |
| 69 pdbname = "{{target_out_dir}}/{{target_output_name}}_cc.pdb" | 77 pdbname = "{{target_out_dir}}/{{target_output_name}}_cc.pdb" |
| 70 command = "ninja -t msvc -e $env -- cl.exe /nologo /showIncludes /FC @$rsp
file /c {{source}} /Fo{{output}} /Fd$pdbname" | 78 command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfil
e /c {{source}} /Fo{{output}} /Fd$pdbname" |
| 71 depsformat = "msvc" | 79 depsformat = "msvc" |
| 72 description = "CXX {{output}}" | 80 description = "CXX {{output}}" |
| 73 outputs = [ | 81 outputs = [ |
| 74 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", | 82 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", |
| 75 ] | 83 ] |
| 76 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" | 84 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" |
| 77 } | 85 } |
| 78 | 86 |
| 79 tool("rc") { | 87 tool("rc") { |
| 80 command = "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{
include_dirs}} /fo{{output}} {{source}}" | 88 command = "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{
include_dirs}} /fo{{output}} {{source}}" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 cpu_arch = "x86" | 190 cpu_arch = "x86" |
| 183 } | 191 } |
| 184 } | 192 } |
| 185 | 193 |
| 186 if (cpu_arch == "x64") { | 194 if (cpu_arch == "x64") { |
| 187 msvc_toolchain("64") { | 195 msvc_toolchain("64") { |
| 188 environment = "environment.x64" | 196 environment = "environment.x64" |
| 189 cpu_arch = "x64" | 197 cpu_arch = "x64" |
| 190 } | 198 } |
| 191 } | 199 } |
| OLD | NEW |