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/sanitizers/sanitizers.gni") | 5 import("//build/config/sanitizers/sanitizers.gni") |
6 import("//build/config/win/visual_studio_version.gni") | 6 import("//build/config/win/visual_studio_version.gni") |
7 import("//build/toolchain/goma.gni") | 7 import("//build/toolchain/goma.gni") |
8 import("//build/toolchain/toolchain.gni") | 8 import("//build/toolchain/toolchain.gni") |
9 | 9 |
10 # Should only be running on Windows. | 10 # Should only be running on Windows. |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
218 description = copy_description | 218 description = copy_description |
219 } | 219 } |
220 | 220 |
221 # When invoking this toolchain not as the default one, these args will be | 221 # When invoking this toolchain not as the default one, these args will be |
222 # passed to the build. They are ignored when this is the default toolchain. | 222 # passed to the build. They are ignored when this is the default toolchain. |
223 toolchain_args() { | 223 toolchain_args() { |
224 current_cpu = invoker.toolchain_cpu | 224 current_cpu = invoker.toolchain_cpu |
225 if (defined(invoker.toolchain_os)) { | 225 if (defined(invoker.toolchain_os)) { |
226 current_os = invoker.toolchain_os | 226 current_os = invoker.toolchain_os |
227 } | 227 } |
228 if (defined(invoker.is_clang)) { | 228 |
229 is_clang = invoker.is_clang | 229 forward_variables_from(invoker, |
230 } | 230 [ |
231 "is_clang", | |
232 "is_component_build", | |
233 ]) | |
231 | 234 |
232 # This value needs to be passed through unchanged. | 235 # This value needs to be passed through unchanged. |
233 host_toolchain = host_toolchain | 236 host_toolchain = host_toolchain |
234 } | 237 } |
235 } | 238 } |
236 } | 239 } |
237 | 240 |
238 if (host_os == "win") { | 241 if (host_os == "win") { |
239 clang_cl = "clang-cl.exe" | 242 clang_cl = "clang-cl.exe" |
240 } else { | 243 } else { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
277 x64_toolchain_data = exec_script("setup_toolchain.py", | 280 x64_toolchain_data = exec_script("setup_toolchain.py", |
278 [ | 281 [ |
279 visual_studio_path, | 282 visual_studio_path, |
280 gyp_win_tool_path, | 283 gyp_win_tool_path, |
281 windows_sdk_path, | 284 windows_sdk_path, |
282 visual_studio_runtime_dirs, | 285 visual_studio_runtime_dirs, |
283 "x64", | 286 "x64", |
284 ], | 287 ], |
285 "scope") | 288 "scope") |
286 | 289 |
287 msvc_toolchain("x64") { | 290 template("win_x64_toolchains") { |
288 environment = "environment.x64" | 291 # TODO(mcgrathr): These assignments are only required because of |
289 toolchain_cpu = "x64" | 292 # crbug.com/395883. Drop them if that ever gets fixed in GN. |
290 cl = "${goma_prefix}\"${x64_toolchain_data.vc_bin_dir}/cl.exe\"" | 293 concurrent_links = invoker.concurrent_links |
291 is_clang = false | 294 goma_prefix = invoker.goma_prefix |
295 x64_toolchain_data = invoker.x64_toolchain_data | |
296 | |
297 msvc_toolchain(target_name) { | |
298 environment = "environment.x64" | |
299 toolchain_cpu = "x64" | |
300 cl = "${goma_prefix}\"${x64_toolchain_data.vc_bin_dir}/cl.exe\"" | |
301 is_clang = false | |
302 | |
303 forward_variables_from(invoker, [ "is_component_build" ]) | |
304 } | |
305 | |
306 msvc_toolchain("clang_" + target_name) { | |
307 environment = "environment.x64" | |
308 toolchain_cpu = "x64" | |
309 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | |
310 root_build_dir) | |
311 cl = "${goma_prefix}$prefix/${clang_cl}" | |
312 toolchain_os = "win" | |
313 is_clang = true | |
314 | |
315 forward_variables_from(invoker, [ "is_component_build" ]) | |
316 } | |
292 } | 317 } |
293 | 318 |
294 msvc_toolchain("clang_x64") { | 319 win_x64_toolchains("x64") { |
295 environment = "environment.x64" | 320 # TODO(mcgrathr): These assignments are only required because of |
296 toolchain_cpu = "x64" | 321 # crbug.com/395883. Drop them if that ever gets fixed in GN. |
297 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 322 concurrent_links = concurrent_links |
298 root_build_dir) | 323 goma_prefix = goma_prefix |
299 cl = "${goma_prefix}$prefix/${clang_cl}" | 324 x64_toolchain_data = x64_toolchain_data |
300 toolchain_os = "win" | 325 } |
301 is_clang = true | 326 |
327 # The nacl_win64 toolchain is nearly identical to the plain x64 toolchain. | |
328 # It's used solely for building nacl64.exe (//components/nacl/broker:nacl64). | |
329 # The only reason it's a separate toolchain is so that it can force | |
330 # is_component_build to false in the toolchain_args() block, because | |
331 # building nacl64.exe in component style does not work. | |
332 win_x64_toolchains("nacl_win64") { | |
333 is_component_build = false | |
334 | |
335 # TODO(mcgrathr): These assignments are only required because of | |
336 # crbug.com/395883. Drop them if that ever gets fixed in GN. | |
337 concurrent_links = concurrent_links | |
338 goma_prefix = goma_prefix | |
339 x64_toolchain_data = x64_toolchain_data | |
Dirk Pranke
2016/01/26 01:42:41
I'm not actually convinced that using the win_x64_
| |
302 } | 340 } |
303 | 341 |
304 # WinRT toolchains. Only define these when targeting them. | 342 # WinRT toolchains. Only define these when targeting them. |
305 # | 343 # |
306 # NOTE: This is currently broken because it references vc_bin_dir. brettw@ | 344 # NOTE: This is currently broken because it references vc_bin_dir. brettw@ |
307 # changed this around a bit, and I don't know what this should be set to | 345 # changed this around a bit, and I don't know what this should be set to |
308 # in terms of what setup_toolchain returns for a certain CPU architecture. | 346 # in terms of what setup_toolchain returns for a certain CPU architecture. |
309 if (target_os == "winrt_81" || target_os == "winrt_81_phone" || | 347 if (target_os == "winrt_81" || target_os == "winrt_81_phone" || |
310 target_os == "winrt_10") { | 348 target_os == "winrt_10") { |
311 msvc_toolchain("winrt_x86") { | 349 msvc_toolchain("winrt_x86") { |
312 environment = "environment.winrt_x86" | 350 environment = "environment.winrt_x86" |
313 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" | 351 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" |
314 is_clang = false | 352 is_clang = false |
315 | 353 |
316 toolchain_cpu = "x86" | 354 toolchain_cpu = "x86" |
317 toolchain_os = current_os | 355 toolchain_os = current_os |
318 } | 356 } |
319 | 357 |
320 msvc_toolchain("winrt_x64") { | 358 msvc_toolchain("winrt_x64") { |
321 environment = "environment.winrt_x64" | 359 environment = "environment.winrt_x64" |
322 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" | 360 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" |
323 is_clang = false | 361 is_clang = false |
324 | 362 |
325 toolchain_cpu = "x64" | 363 toolchain_cpu = "x64" |
326 toolchain_os = current_os | 364 toolchain_os = current_os |
327 } | 365 } |
328 } | 366 } |
OLD | NEW |