Chromium Code Reviews| 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 #include <algorithm> | 5 #include <algorithm> |
| 6 #include <limits> | 6 #include <limits> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "tools/gn/err.h" | 9 #include "tools/gn/err.h" |
| 10 #include "tools/gn/functions.h" | 10 #include "tools/gn/functions.h" |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 521 "objc": Objective C compiler | 521 "objc": Objective C compiler |
| 522 "objcxx": Objective C++ compiler | 522 "objcxx": Objective C++ compiler |
| 523 "rc": Resource compiler (Windows .rc files) | 523 "rc": Resource compiler (Windows .rc files) |
| 524 "asm": Assembler | 524 "asm": Assembler |
| 525 | 525 |
| 526 Linker tools: | 526 Linker tools: |
| 527 "alink": Linker for static libraries (archives) | 527 "alink": Linker for static libraries (archives) |
| 528 "solink": Linker for shared libraries | 528 "solink": Linker for shared libraries |
| 529 "link": Linker for executables | 529 "link": Linker for executables |
| 530 | 530 |
| 531 Other tools: | 531 Other tools: |
|
brettw
2017/06/08 18:36:20
I think you want "action" here.
Petr Hosek
2017/06/09 03:24:32
Done.
| |
| 532 "stamp": Tool for creating stamp files | 532 "stamp": Tool for creating stamp files |
| 533 "copy": Tool to copy files. | 533 "copy": Tool to copy files. |
| 534 | 534 |
| 535 Platform specific tools: | 535 Platform specific tools: |
| 536 "copy_bundle_data": [iOS, OS X] Tool to copy files in a bundle. | 536 "copy_bundle_data": [iOS, OS X] Tool to copy files in a bundle. |
| 537 "compile_xcassets": [iOS, OS X] Tool to compile asset catalogs. | 537 "compile_xcassets": [iOS, OS X] Tool to compile asset catalogs. |
| 538 | 538 |
| 539 Tool variables | 539 Tool variables |
| 540 | 540 |
| 541 command [string with substitutions] | 541 command [string with substitutions] |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 631 | 631 |
| 632 Example for a linker tool that produces a .dll and a .lib. The use of | 632 Example for a linker tool that produces a .dll and a .lib. The use of |
| 633 {{target_output_name}}, {{output_extension}} and {{output_dir}} allows | 633 {{target_output_name}}, {{output_extension}} and {{output_dir}} allows |
| 634 the target to override these values. | 634 the target to override these values. |
| 635 outputs = [ | 635 outputs = [ |
| 636 "{{output_dir}}/{{target_output_name}}" | 636 "{{output_dir}}/{{target_output_name}}" |
| 637 "{{output_extension}}", | 637 "{{output_extension}}", |
| 638 "{{output_dir}}/{{target_output_name}}.lib", | 638 "{{output_dir}}/{{target_output_name}}.lib", |
| 639 ] | 639 ] |
| 640 | 640 |
| 641 pool [label, optional] | 641 pool [label, optional] |
|
brettw
2017/06/08 18:36:19
I think this is valid for all tools. Can you add a
Petr Hosek
2017/06/09 03:24:32
Done.
| |
| 642 | 642 |
| 643 Label of the pool to use for the tool. Pools are used to limit the | 643 Label of the pool to use for the tool. Pools are used to limit the |
| 644 number of tasks that can execute concurrently during the build. | 644 number of tasks that can execute concurrently during the build. |
| 645 | 645 |
| 646 See also "gn help pool". | 646 See also "gn help pool". |
| 647 | 647 |
| 648 link_output [string with substitutions] | 648 link_output [string with substitutions] |
| 649 depend_output [string with substitutions] | 649 depend_output [string with substitutions] |
| 650 Valid for: "solink" only (optional) | 650 Valid for: "solink" only (optional) |
| 651 | 651 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 702 | 702 |
| 703 Normally, Ninja will assume that when a tool runs the output be new and | 703 Normally, Ninja will assume that when a tool runs the output be new and |
| 704 downstream dependents must be rebuild. When this is set to trye, Ninja | 704 downstream dependents must be rebuild. When this is set to trye, Ninja |
| 705 can skip rebuilding downstream dependents for input changes that don't | 705 can skip rebuilding downstream dependents for input changes that don't |
| 706 actually affect the output. | 706 actually affect the output. |
| 707 | 707 |
| 708 Example: | 708 Example: |
| 709 restat = true | 709 restat = true |
| 710 | 710 |
| 711 rspfile [string with substitutions] | 711 rspfile [string with substitutions] |
| 712 Valid for: all tools (optional) | 712 Valid for: all tools (optional) |
|
brettw
2017/06/08 18:36:20
This and the next one I think don't apply to actio
Petr Hosek
2017/06/09 03:24:33
Done.
| |
| 713 | 713 |
| 714 Name of the response file. If empty, no response file will be | 714 Name of the response file. If empty, no response file will be |
| 715 used. See "rspfile_content". | 715 used. See "rspfile_content". |
| 716 | 716 |
| 717 rspfile_content [string with substitutions] | 717 rspfile_content [string with substitutions] |
| 718 Valid for: all tools (required when "rspfile" is specified) | 718 Valid for: all tools (required when "rspfile" is specified) |
| 719 | 719 |
| 720 The contents to be written to the response file. This may include all | 720 The contents to be written to the response file. This may include all |
| 721 or part of the command to send to the tool which allows you to get | 721 or part of the command to send to the tool which allows you to get |
| 722 around OS command-line length limits. | 722 around OS command-line length limits. |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1044 !ReadBool(&block_scope, "restat", tool.get(), &Tool::set_restat, err) || | 1044 !ReadBool(&block_scope, "restat", tool.get(), &Tool::set_restat, err) || |
| 1045 !ReadPattern(&block_scope, "rspfile", subst_validator, tool.get(), | 1045 !ReadPattern(&block_scope, "rspfile", subst_validator, tool.get(), |
| 1046 &Tool::set_rspfile, err) || | 1046 &Tool::set_rspfile, err) || |
| 1047 !ReadPattern(&block_scope, "rspfile_content", subst_validator, tool.get(), | 1047 !ReadPattern(&block_scope, "rspfile_content", subst_validator, tool.get(), |
| 1048 &Tool::set_rspfile_content, err) || | 1048 &Tool::set_rspfile_content, err) || |
| 1049 !ReadLabel(&block_scope, "pool", tool.get(), toolchain->label(), | 1049 !ReadLabel(&block_scope, "pool", tool.get(), toolchain->label(), |
| 1050 &Tool::set_pool, err)) { | 1050 &Tool::set_pool, err)) { |
| 1051 return Value(); | 1051 return Value(); |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 if (tool_type != Toolchain::TYPE_COPY && | 1054 if (tool_type != Toolchain::TYPE_COPY && tool_type != Toolchain::TYPE_STAMP && |
| 1055 tool_type != Toolchain::TYPE_STAMP && | |
| 1056 tool_type != Toolchain::TYPE_COPY_BUNDLE_DATA && | 1055 tool_type != Toolchain::TYPE_COPY_BUNDLE_DATA && |
| 1057 tool_type != Toolchain::TYPE_COMPILE_XCASSETS) { | 1056 tool_type != Toolchain::TYPE_COMPILE_XCASSETS && |
| 1057 tool_type != Toolchain::TYPE_ACTION) { | |
| 1058 // All tools should have outputs, except the copy, stamp, copy_bundle_data | 1058 // All tools should have outputs, except the copy, stamp, copy_bundle_data |
| 1059 // and compile_xcassets tools that generate their outputs internally. | 1059 // compile_xcassets and action tools that generate their outputs internally. |
| 1060 if (!ReadPatternList(&block_scope, "outputs", subst_output_validator, | 1060 if (!ReadPatternList(&block_scope, "outputs", subst_output_validator, |
| 1061 tool.get(), &Tool::set_outputs, err) || | 1061 tool.get(), &Tool::set_outputs, err) || |
| 1062 !ValidateOutputs(tool.get(), err)) | 1062 !ValidateOutputs(tool.get(), err)) |
| 1063 return Value(); | 1063 return Value(); |
| 1064 } | 1064 } |
| 1065 if (!ValidateRuntimeOutputs(tool.get(), tool_type, err)) | 1065 if (!ValidateRuntimeOutputs(tool.get(), tool_type, err)) |
| 1066 return Value(); | 1066 return Value(); |
| 1067 | 1067 |
| 1068 // Validate link_output and depend_output. | 1068 // Validate link_output and depend_output. |
| 1069 if (!ValidateLinkAndDependOutput(tool.get(), tool_type, tool->link_output(), | 1069 if (!ValidateLinkAndDependOutput(tool.get(), tool_type, tool->link_output(), |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 1081 | 1081 |
| 1082 // Make sure there weren't any vars set in this tool that were unused. | 1082 // Make sure there weren't any vars set in this tool that were unused. |
| 1083 if (!block_scope.CheckForUnusedVars(err)) | 1083 if (!block_scope.CheckForUnusedVars(err)) |
| 1084 return Value(); | 1084 return Value(); |
| 1085 | 1085 |
| 1086 toolchain->SetTool(tool_type, std::move(tool)); | 1086 toolchain->SetTool(tool_type, std::move(tool)); |
| 1087 return Value(); | 1087 return Value(); |
| 1088 } | 1088 } |
| 1089 | 1089 |
| 1090 } // namespace functions | 1090 } // namespace functions |
| OLD | NEW |