Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: tools/gn/variables.cc

Issue 1207903002: Windows precompiled header support in GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Scott's grammar nits Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/variables.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 "\n" 847 "\n"
848 " Outputs is valid for \"copy\", \"action\", and \"action_foreach\"\n" 848 " Outputs is valid for \"copy\", \"action\", and \"action_foreach\"\n"
849 " target types and indicates the resulting files. The values may contain\n" 849 " target types and indicates the resulting files. The values may contain\n"
850 " source expansions to generate the output names from the sources (see\n" 850 " source expansions to generate the output names from the sources (see\n"
851 " \"gn help source_expansion\").\n" 851 " \"gn help source_expansion\").\n"
852 "\n" 852 "\n"
853 " For copy targets, the outputs is the destination for the copied\n" 853 " For copy targets, the outputs is the destination for the copied\n"
854 " file(s). For actions, the outputs should be the list of files\n" 854 " file(s). For actions, the outputs should be the list of files\n"
855 " generated by the script.\n"; 855 " generated by the script.\n";
856 856
857 const char kPrecompiledHeader[] = "precompiled_header";
858 const char kPrecompiledHeader_HelpShort[] =
859 "precompiled_header: [string] Header file to precompile.";
860 const char kPrecompiledHeader_Help[] =
861 "precompiled_header: [string] Header file to precompile.\n"
862 "\n"
863 " Precompiled headers will be used when a target specifies this\n"
864 " value, or a config applying to this target specifies this value.\n"
865 " In addition, the tool corresponding to the source files must also\n"
866 " specify precompiled headers (see \"gn help tool\"). The tool\n"
867 " will also specify what type of precompiled headers to use.\n"
868 "\n"
869 " The precompiled header/source variables can be specified on a target\n"
870 " or a config, but must be the same for all configs applying to a given\n"
871 " target since a target can only have one precompiled header.\n"
872 "\n"
873 "MSVC precompiled headers\n"
874 "\n"
875 " When using MSVC-style precompiled headers, the \"precompiled_header\"\n"
876 " value is a string corresponding to the header. This is NOT a path\n"
877 " to a file that GN recognises, but rather the exact string that appears\n"
878 " in quotes after an #include line in source code. The compiler will\n"
879 " match this string against includes or forced includes (/FI).\n"
880 "\n"
881 " MSVC also requires a source file to compile the header with. This must\n"
882 " be specified by the \"precompiled_source\" value. In contrast to the\n"
883 " header value, this IS a GN-style file name, and tells GN which source\n"
884 " file to compile to make the .pch file used for subsequent compiles.\n"
885 "\n"
886 " If you use both C and C++ sources, the precompiled header and source\n"
887 " file will be compiled using both tools. You will want to make sure\n"
888 " to wrap C++ includes in __cplusplus #ifdefs so the file will compile\n"
889 " in C mode.\n"
890 "\n"
891 " For example, if the toolchain specifies MSVC headers:\n"
892 "\n"
893 " toolchain(\"vc_x64\") {\n"
894 " ...\n"
895 " tool(\"cxx\") {\n"
896 " precompiled_header_type = \"msvc\"\n"
897 " ...\n"
898 "\n"
899 " You might make a config like this:\n"
900 "\n"
901 " config(\"use_precompiled_headers\") {\n"
902 " precompiled_header = \"build/precompile.h\"\n"
903 " precompiled_source = \"//build/precompile.cc\"\n"
904 "\n"
905 " # Either your source files should #include \"build/precompile.h\"\n"
906 " # first, or you can do this to force-include the header.\n"
907 " cflags = [ \"/FI$precompiled_header\" ]\n"
908 " }\n"
909 "\n"
910 " And then define a target that uses the config:\n"
911 "\n"
912 " executable(\"doom_melon\") {\n"
913 " configs += [ \":use_precompiled_headers\" ]\n"
914 " ...\n"
915 "\n";
916
917 const char kPrecompiledSource[] = "precompiled_source";
918 const char kPrecompiledSource_HelpShort[] =
919 "precompiled_source: [file name] Source file to precompile.";
920 const char kPrecompiledSource_Help[] =
921 "precompiled_source: [file name] Source file to precompile.\n"
922 "\n"
923 " The source file that goes along with the precompiled_header when\n"
924 " using \"msvc\"-style precompiled headers. It will be implicitly added\n"
925 " to the sources of the target. See \"gn help precompiled_header\".\n";
926
857 const char kPublic[] = "public"; 927 const char kPublic[] = "public";
858 const char kPublic_HelpShort[] = 928 const char kPublic_HelpShort[] =
859 "public: [file list] Declare public header files for a target."; 929 "public: [file list] Declare public header files for a target.";
860 const char kPublic_Help[] = 930 const char kPublic_Help[] =
861 "public: Declare public header files for a target.\n" 931 "public: Declare public header files for a target.\n"
862 "\n" 932 "\n"
863 " A list of files that other targets can include. These permissions are\n" 933 " A list of files that other targets can include. These permissions are\n"
864 " checked via the \"check\" command (see \"gn help check\").\n" 934 " checked via the \"check\" command (see \"gn help check\").\n"
865 "\n" 935 "\n"
866 " If no public files are declared, other targets (assuming they have\n" 936 " If no public files are declared, other targets (assuming they have\n"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 INSERT_VARIABLE(Deps) 1184 INSERT_VARIABLE(Deps)
1115 INSERT_VARIABLE(ForwardDependentConfigsFrom) 1185 INSERT_VARIABLE(ForwardDependentConfigsFrom)
1116 INSERT_VARIABLE(IncludeDirs) 1186 INSERT_VARIABLE(IncludeDirs)
1117 INSERT_VARIABLE(Inputs) 1187 INSERT_VARIABLE(Inputs)
1118 INSERT_VARIABLE(Ldflags) 1188 INSERT_VARIABLE(Ldflags)
1119 INSERT_VARIABLE(Libs) 1189 INSERT_VARIABLE(Libs)
1120 INSERT_VARIABLE(LibDirs) 1190 INSERT_VARIABLE(LibDirs)
1121 INSERT_VARIABLE(OutputExtension) 1191 INSERT_VARIABLE(OutputExtension)
1122 INSERT_VARIABLE(OutputName) 1192 INSERT_VARIABLE(OutputName)
1123 INSERT_VARIABLE(Outputs) 1193 INSERT_VARIABLE(Outputs)
1194 INSERT_VARIABLE(PrecompiledHeader)
1195 INSERT_VARIABLE(PrecompiledSource)
1124 INSERT_VARIABLE(Public) 1196 INSERT_VARIABLE(Public)
1125 INSERT_VARIABLE(PublicConfigs) 1197 INSERT_VARIABLE(PublicConfigs)
1126 INSERT_VARIABLE(PublicDeps) 1198 INSERT_VARIABLE(PublicDeps)
1127 INSERT_VARIABLE(Script) 1199 INSERT_VARIABLE(Script)
1128 INSERT_VARIABLE(Sources) 1200 INSERT_VARIABLE(Sources)
1129 INSERT_VARIABLE(Testonly) 1201 INSERT_VARIABLE(Testonly)
1130 INSERT_VARIABLE(Visibility) 1202 INSERT_VARIABLE(Visibility)
1131 } 1203 }
1132 return info_map; 1204 return info_map;
1133 } 1205 }
1134 1206
1135 #undef INSERT_VARIABLE 1207 #undef INSERT_VARIABLE
1136 1208
1137 } // namespace variables 1209 } // namespace variables
OLDNEW
« no previous file with comments | « tools/gn/variables.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698