| 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 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires | 5 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires |
| 6 # some enhancements since the commands on Mac are slightly different than on | 6 # some enhancements since the commands on Mac are slightly different than on |
| 7 # Linux. | 7 # Linux. |
| 8 | 8 |
| 9 import("../goma.gni") | 9 import("../goma.gni") |
| 10 import("//build/config/ios/ios_sdk.gni") | 10 import("//build/config/ios/ios_sdk.gni") |
| 11 import("//build/config/mac/mac_sdk.gni") | 11 import("//build/config/mac/mac_sdk.gni") |
| 12 import("//build/config/mac/symbols.gni") | 12 import("//build/config/mac/symbols.gni") |
| 13 | 13 |
| 14 assert(host_os == "mac") | 14 assert(host_os == "mac") |
| 15 | 15 |
| 16 import("//build/toolchain/goma.gni") | 16 import("//build/toolchain/goma.gni") |
| 17 import("//build/toolchain/toolchain.gni") | 17 import("//build/toolchain/toolchain.gni") |
| 18 import("//build/toolchain/concurrent_links.gni") | 18 import("//build/toolchain/concurrent_links.gni") |
| 19 | 19 |
| 20 if (use_goma) { | 20 if (use_goma) { |
| 21 goma_prefix = "$goma_dir/gomacc " | 21 goma_prefix = "$goma_dir/gomacc " |
| 22 } else { | 22 } else { |
| 23 goma_prefix = "" | 23 goma_prefix = "" |
| 24 } | 24 } |
| 25 | 25 |
| 26 if (current_toolchain == default_toolchain) { |
| 27 # Reduce the number of tasks using the copy_bundle_data and compile_xcassets |
| 28 # tools as they can cause lots of I/O contention when invoking ninja with a |
| 29 # large number of parallel jobs (e.g. when using distributed build like goma). |
| 30 pool("bundle_pool") { |
| 31 depth = concurrent_links |
| 32 } |
| 33 } |
| 34 |
| 26 # This will copy the gyp-mac-tool to the build directory. We pass in the source | 35 # This will copy the gyp-mac-tool to the build directory. We pass in the source |
| 27 # file of the mac tool. | 36 # file of the mac tool. |
| 28 gyp_mac_tool_source = | 37 gyp_mac_tool_source = |
| 29 rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", root_build_dir) | 38 rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", root_build_dir) |
| 30 exec_script("setup_toolchain.py", [ gyp_mac_tool_source ]) | 39 exec_script("setup_toolchain.py", [ gyp_mac_tool_source ]) |
| 31 | 40 |
| 32 # Shared toolchain definition. Invocations should set toolchain_os to set the | 41 # Shared toolchain definition. Invocations should set toolchain_os to set the |
| 33 # build args in this definition. | 42 # build args in this definition. |
| 34 template("mac_toolchain") { | 43 template("mac_toolchain") { |
| 35 toolchain(target_name) { | 44 toolchain(target_name) { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 tool("copy") { | 273 tool("copy") { |
| 265 command = copy_command | 274 command = copy_command |
| 266 description = copy_description | 275 description = copy_description |
| 267 } | 276 } |
| 268 | 277 |
| 269 tool("copy_bundle_data") { | 278 tool("copy_bundle_data") { |
| 270 _tool = rebase_path("//build/toolchain/mac/copy_bundle_data.py", | 279 _tool = rebase_path("//build/toolchain/mac/copy_bundle_data.py", |
| 271 root_build_dir) | 280 root_build_dir) |
| 272 command = "python $_tool {{source}} {{output}}" | 281 command = "python $_tool {{source}} {{output}}" |
| 273 description = "COPY_BUNDLE_DATA {{source}} {{output}}" | 282 description = "COPY_BUNDLE_DATA {{source}} {{output}}" |
| 283 pool = ":bundle_pool($default_toolchain)" |
| 274 } | 284 } |
| 275 tool("compile_xcassets") { | 285 tool("compile_xcassets") { |
| 276 _tool = rebase_path("//build/toolchain/mac/compile_xcassets.py", | 286 _tool = rebase_path("//build/toolchain/mac/compile_xcassets.py", |
| 277 root_build_dir) | 287 root_build_dir) |
| 278 if (is_ios) { | 288 if (is_ios) { |
| 279 _sdk_name = ios_sdk_name | 289 _sdk_name = ios_sdk_name |
| 280 _min_deployment_target = ios_deployment_target | 290 _min_deployment_target = ios_deployment_target |
| 281 } else { | 291 } else { |
| 282 _sdk_name = mac_sdk_name | 292 _sdk_name = mac_sdk_name |
| 283 _min_deployment_target = mac_deployment_target | 293 _min_deployment_target = mac_deployment_target |
| 284 } | 294 } |
| 285 command = "rm -f {{output}} && " + | 295 command = "rm -f {{output}} && " + |
| 286 "python $_tool -p $_sdk_name -t $_min_deployment_target " + | 296 "python $_tool -p $_sdk_name -t $_min_deployment_target " + |
| 287 "-o {{output}} {{inputs}}" | 297 "-o {{output}} {{inputs}}" |
| 288 | 298 |
| 289 description = "COMPILE_XCASSETS {{output}}" | 299 description = "COMPILE_XCASSETS {{output}}" |
| 300 pool = ":bundle_pool($default_toolchain)" |
| 290 } | 301 } |
| 291 | 302 |
| 292 toolchain_args() { | 303 toolchain_args() { |
| 293 current_cpu = invoker.toolchain_cpu | 304 current_cpu = invoker.toolchain_cpu |
| 294 current_os = invoker.toolchain_os | 305 current_os = invoker.toolchain_os |
| 295 | 306 |
| 296 # These values need to be passed through unchanged. | 307 # These values need to be passed through unchanged. |
| 297 host_toolchain = host_toolchain | 308 host_toolchain = host_toolchain |
| 298 target_os = target_os | 309 target_os = target_os |
| 299 target_cpu = target_cpu | 310 target_cpu = target_cpu |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 } | 390 } |
| 380 | 391 |
| 381 mac_toolchain("x64") { | 392 mac_toolchain("x64") { |
| 382 toolchain_cpu = "x64" | 393 toolchain_cpu = "x64" |
| 383 toolchain_os = "mac" | 394 toolchain_os = "mac" |
| 384 cc = "${goma_prefix}/gcc" | 395 cc = "${goma_prefix}/gcc" |
| 385 cxx = "${goma_prefix}/g++" | 396 cxx = "${goma_prefix}/g++" |
| 386 ld = cxx | 397 ld = cxx |
| 387 is_clang = false | 398 is_clang = false |
| 388 } | 399 } |
| OLD | NEW |