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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 "Example\n" | 885 "Example\n" |
886 "\n" | 886 "\n" |
887 " lib_dirs = [ \"/usr/lib/foo\", \"lib/doom_melon\" ]\n"; | 887 " lib_dirs = [ \"/usr/lib/foo\", \"lib/doom_melon\" ]\n"; |
888 | 888 |
889 const char kLibs[] = "libs"; | 889 const char kLibs[] = "libs"; |
890 const char kLibs_HelpShort[] = | 890 const char kLibs_HelpShort[] = |
891 "libs: [string list] Additional libraries to link."; | 891 "libs: [string list] Additional libraries to link."; |
892 const char kLibs_Help[] = | 892 const char kLibs_Help[] = |
893 "libs: Additional libraries to link.\n" | 893 "libs: Additional libraries to link.\n" |
894 "\n" | 894 "\n" |
895 " A list of strings.\n" | 895 " A list of library names or library paths.\n" |
896 "\n" | 896 "\n" |
897 " These files will be passed to the linker, which will generally search\n" | 897 "Values containing '/' will be treated as references to files in the\n" |
898 " the library include path. Unlike a normal list of files, they will be\n" | 898 "build. They will be rebased to be relative to the build directory and\n" |
899 " passed to the linker unmodified rather than being treated as file\n" | 899 "specified in the \"libs\" for linker tools. This facility should be used\n" |
900 " names relative to the current build file. Generally you would set\n" | 900 "for libraries that are checked in to the build. For libraries that are\n" |
901 " the \"lib_dirs\" so your library is found. If you need to specify\n" | 901 "generated by the build, use normal GN deps to link them.\n" |
902 " a path, you can use \"rebase_path\" to convert a path to be relative\n" | |
903 " to the build directory.\n" | |
904 "\n" | 902 "\n" |
905 " When constructing the linker command, the \"lib_prefix\" attribute of\n" | 903 "Values not containing '/' will be treated as system library names. These\n" |
906 " the linker tool in the current toolchain will be prepended to each\n" | 904 "will be passed unmodified to the linker and prefixed with the\n" |
907 " library. So your BUILD file should not specify the switch prefix\n" | 905 "\"lib_prefix\" attribute of the linker tool. Generally you would set the\n" |
908 " (like \"-l\").\n" | 906 "\"lib_dirs\" so the given library is found. Your BUILD.gn file should\n" |
| 907 "not specify the switch prefix (like \"-l\"): this will be encoded in\n" |
| 908 "the \"lib_prefix\" of the tool.\n" |
909 "\n" | 909 "\n" |
910 " Libraries ending in \".framework\" will be special-cased: the switch\n" | 910 " Libraries ending in \".framework\" will be special-cased: the switch\n" |
911 " \"-framework\" will be prepended instead of the lib_prefix, and the\n" | 911 " \"-framework\" will be prepended instead of the lib_prefix, and the\n" |
912 " \".framework\" suffix will be trimmed. This is to support the way Mac\n" | 912 " \".framework\" suffix will be trimmed. This is to support the way Mac\n" |
913 " links framework dependencies.\n" | 913 " links framework dependencies.\n" |
914 COMMON_LIB_INHERITANCE_HELP | 914 COMMON_LIB_INHERITANCE_HELP |
915 COMMON_ORDERING_HELP | 915 COMMON_ORDERING_HELP |
916 LIBS_AND_LIB_DIRS_ORDERING_HELP | 916 LIBS_AND_LIB_DIRS_ORDERING_HELP |
917 "\n" | 917 "\n" |
918 "Examples\n" | 918 "Examples\n" |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 INSERT_VARIABLE(Sources) | 1432 INSERT_VARIABLE(Sources) |
1433 INSERT_VARIABLE(Testonly) | 1433 INSERT_VARIABLE(Testonly) |
1434 INSERT_VARIABLE(Visibility) | 1434 INSERT_VARIABLE(Visibility) |
1435 } | 1435 } |
1436 return info_map; | 1436 return info_map; |
1437 } | 1437 } |
1438 | 1438 |
1439 #undef INSERT_VARIABLE | 1439 #undef INSERT_VARIABLE |
1440 | 1440 |
1441 } // namespace variables | 1441 } // namespace variables |
OLD | NEW |