| 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 clang_cl = invoker.clang_cl |
| 297 |
| 298 msvc_toolchain(target_name) { |
| 299 environment = "environment.x64" |
| 300 toolchain_cpu = "x64" |
| 301 cl = "${goma_prefix}\"${x64_toolchain_data.vc_bin_dir}/cl.exe\"" |
| 302 is_clang = false |
| 303 |
| 304 forward_variables_from(invoker, [ "is_component_build" ]) |
| 305 } |
| 306 |
| 307 msvc_toolchain("clang_" + target_name) { |
| 308 environment = "environment.x64" |
| 309 toolchain_cpu = "x64" |
| 310 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", |
| 311 root_build_dir) |
| 312 cl = "${goma_prefix}$prefix/${clang_cl}" |
| 313 toolchain_os = "win" |
| 314 is_clang = true |
| 315 |
| 316 forward_variables_from(invoker, [ "is_component_build" ]) |
| 317 } |
| 292 } | 318 } |
| 293 | 319 |
| 294 msvc_toolchain("clang_x64") { | 320 win_x64_toolchains("x64") { |
| 295 environment = "environment.x64" | 321 # TODO(mcgrathr): These assignments are only required because of |
| 296 toolchain_cpu = "x64" | 322 # crbug.com/395883. Drop them if that ever gets fixed in GN. |
| 297 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 323 concurrent_links = concurrent_links |
| 298 root_build_dir) | 324 goma_prefix = goma_prefix |
| 299 cl = "${goma_prefix}$prefix/${clang_cl}" | 325 x64_toolchain_data = x64_toolchain_data |
| 300 toolchain_os = "win" | 326 } |
| 301 is_clang = true | 327 |
| 328 # The nacl_win64 toolchain is nearly identical to the plain x64 toolchain. |
| 329 # It's used solely for building nacl64.exe (//components/nacl/broker:nacl64). |
| 330 # The only reason it's a separate toolchain is so that it can force |
| 331 # is_component_build to false in the toolchain_args() block, because |
| 332 # building nacl64.exe in component style does not work. |
| 333 win_x64_toolchains("nacl_win64") { |
| 334 is_component_build = false |
| 335 |
| 336 # TODO(mcgrathr): These assignments are only required because of |
| 337 # crbug.com/395883. Drop them if that ever gets fixed in GN. |
| 338 concurrent_links = concurrent_links |
| 339 goma_prefix = goma_prefix |
| 340 x64_toolchain_data = x64_toolchain_data |
| 341 clang_cl = clang_cl |
| 302 } | 342 } |
| 303 | 343 |
| 304 # WinRT toolchains. Only define these when targeting them. | 344 # WinRT toolchains. Only define these when targeting them. |
| 305 # | 345 # |
| 306 # NOTE: This is currently broken because it references vc_bin_dir. brettw@ | 346 # 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 | 347 # 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. | 348 # in terms of what setup_toolchain returns for a certain CPU architecture. |
| 309 if (target_os == "winrt_81" || target_os == "winrt_81_phone" || | 349 if (target_os == "winrt_81" || target_os == "winrt_81_phone" || |
| 310 target_os == "winrt_10") { | 350 target_os == "winrt_10") { |
| 311 msvc_toolchain("winrt_x86") { | 351 msvc_toolchain("winrt_x86") { |
| 312 environment = "environment.winrt_x86" | 352 environment = "environment.winrt_x86" |
| 313 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" | 353 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" |
| 314 is_clang = false | 354 is_clang = false |
| 315 | 355 |
| 316 toolchain_cpu = "x86" | 356 toolchain_cpu = "x86" |
| 317 toolchain_os = current_os | 357 toolchain_os = current_os |
| 318 } | 358 } |
| 319 | 359 |
| 320 msvc_toolchain("winrt_x64") { | 360 msvc_toolchain("winrt_x64") { |
| 321 environment = "environment.winrt_x64" | 361 environment = "environment.winrt_x64" |
| 322 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" | 362 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" |
| 323 is_clang = false | 363 is_clang = false |
| 324 | 364 |
| 325 toolchain_cpu = "x64" | 365 toolchain_cpu = "x64" |
| 326 toolchain_os = current_os | 366 toolchain_os = current_os |
| 327 } | 367 } |
| 328 } | 368 } |
| OLD | NEW |