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 "tools/gn/variables.h" | 5 #include "tools/gn/variables.h" |
6 | 6 |
7 namespace variables { | 7 namespace variables { |
8 | 8 |
9 // Built-in variables ---------------------------------------------------------- | 9 // Built-in variables ---------------------------------------------------------- |
10 | 10 |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 "Script input gotchas\n" | 979 "Script input gotchas\n" |
980 "\n" | 980 "\n" |
981 " It may be tempting to write a script that enumerates all files in a\n" | 981 " It may be tempting to write a script that enumerates all files in a\n" |
982 " directory as inputs. Don't do this! Even if you specify all the files\n" | 982 " directory as inputs. Don't do this! Even if you specify all the files\n" |
983 " in the inputs or sources in the GN target (or worse, enumerate the\n" | 983 " in the inputs or sources in the GN target (or worse, enumerate the\n" |
984 " files in an exec_script call when running GN, which will be slow), the\n" | 984 " files in an exec_script call when running GN, which will be slow), the\n" |
985 " dependencies will be broken.\n" | 985 " dependencies will be broken.\n" |
986 "\n" | 986 "\n" |
987 " The problem happens if a file is ever removed because the inputs are\n" | 987 " The problem happens if a file is ever removed because the inputs are\n" |
988 " not listed on the command line to the script. Because the script\n" | 988 " not listed on the command line to the script. Because the script\n" |
989 " hasn't changed and all inputs are up-to-date, the script will not\n" | 989 " hasn't changed and all inputs are up to date, the script will not\n" |
990 " re-run and you will get a stale build. Instead, either list all\n" | 990 " re-run and you will get a stale build. Instead, either list all\n" |
991 " inputs on the command line to the script, or if there are many, create\n" | 991 " inputs on the command line to the script, or if there are many, create\n" |
992 " a separate list file that the script reads. As long as this file is\n" | 992 " a separate list file that the script reads. As long as this file is\n" |
993 " listed in the inputs, the build will detect when it has changed in any\n" | 993 " listed in the inputs, the build will detect when it has changed in any\n" |
994 " way and the action will re-run.\n" | 994 " way and the action will re-run.\n" |
995 "\n" | 995 "\n" |
996 "Inputs for binary targets\n" | 996 "Inputs for binary targets\n" |
997 "\n" | 997 "\n" |
998 " Any input dependencies will be resolved before compiling any sources.\n" | 998 " Any input dependencies will be resolved before compiling any sources.\n" |
999 " Normally, all actions that a target depends on will be run before any\n" | 999 " Normally, all actions that a target depends on will be run before any\n" |
1000 " files in a target are compiled. So if you depend on generated headers,\n" | 1000 " files in a target are compiled. So if you depend on generated headers,\n" |
1001 " you do not typically need to list them in the inputs section.\n" | 1001 " you do not typically need to list them in the inputs section.\n" |
1002 "\n" | 1002 "\n" |
1003 " Inputs for binary targets will be treated as order-only dependencies,\n" | 1003 " Inputs for binary targets will be treated as order-only dependencies,\n" |
1004 " meaning that they will be forced up-to-date before compiling or\n" | 1004 " meaning that they will be forced up to date before compiling or\n" |
1005 " any files in the target, but changes in the inputs will not\n" | 1005 " any files in the target, but changes in the inputs will not\n" |
1006 " necessarily force the target to compile. This is because it is\n" | 1006 " necessarily force the target to compile. This is because it is\n" |
1007 " expected that the compiler will report the precise list of input\n" | 1007 " expected that the compiler will report the precise list of input\n" |
1008 " dependencies required to recompile each file once the initial build\n" | 1008 " dependencies required to recompile each file once the initial build\n" |
1009 " is done.\n" | 1009 " is done.\n" |
1010 "\n" | 1010 "\n" |
1011 "Example\n" | 1011 "Example\n" |
1012 "\n" | 1012 "\n" |
1013 " action(\"myscript\") {\n" | 1013 " action(\"myscript\") {\n" |
1014 " script = \"domything.py\"\n" | 1014 " script = \"domything.py\"\n" |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1728 INSERT_VARIABLE(Testonly) | 1728 INSERT_VARIABLE(Testonly) |
1729 INSERT_VARIABLE(Visibility) | 1729 INSERT_VARIABLE(Visibility) |
1730 INSERT_VARIABLE(WriteRuntimeDeps) | 1730 INSERT_VARIABLE(WriteRuntimeDeps) |
1731 } | 1731 } |
1732 return info_map; | 1732 return info_map; |
1733 } | 1733 } |
1734 | 1734 |
1735 #undef INSERT_VARIABLE | 1735 #undef INSERT_VARIABLE |
1736 | 1736 |
1737 } // namespace variables | 1737 } // namespace variables |
OLD | NEW |