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

Unified Diff: tools/gn/function_toolchain.cc

Issue 1292983004: [GN]: Precompiled header support for GCC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/config_values_generator.h ('k') | tools/gn/ninja_binary_target_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_toolchain.cc
diff --git a/tools/gn/function_toolchain.cc b/tools/gn/function_toolchain.cc
index 4e1fe2d418e684c07616a352b3689b66e2642c7b..8758e429f409250a43f9f1f727008c9bafda1f67 100644
--- a/tools/gn/function_toolchain.cc
+++ b/tools/gn/function_toolchain.cc
@@ -20,7 +20,7 @@ namespace functions {
namespace {
-// This is jsut a unique value to take the address of to use as the key for
+// This is just a unique value to take the address of to use as the key for
// the toolchain property on a scope.
const int kToolchainPropertyKey = 0;
@@ -124,12 +124,15 @@ bool ReadPrecompiledHeaderType(Scope* scope, Tool* tool, Err* err) {
if (value->string_value().empty())
return true; // Accept empty string, do nothing (default is "no PCH").
- if (value->string_value() == "msvc") {
+ if (value->string_value() == "gcc") {
+ tool->set_precompiled_header_type(Tool::PCH_GCC);
+ return true;
+ } else if (value->string_value() == "msvc") {
tool->set_precompiled_header_type(Tool::PCH_MSVC);
return true;
}
*err = Err(*value, "Invalid precompiled_header_type",
- "Must either be empty or \"msvc\".");
+ "Must either be empty, \"gcc\", or \"msvc\".");
return false;
}
@@ -531,12 +534,14 @@ const char kTool_Help[] =
"\n"
" Type of precompiled headers. If undefined or the empty string,\n"
" precompiled headers will not be used for this tool. Otherwise\n"
- " use \"msvc\" which is the only currently supported value.\n"
+ " use \"gcc\" or \"msvc\".\n"
"\n"
" For precompiled headers to be used for a given target, the\n"
" target (or a config applied to it) must also specify a\n"
" \"precompiled_header\" and, for \"msvc\"-style headers, a\n"
- " \"precompiled_source\" value.\n"
+ " \"precompiled_source\" value. If the type is \"gcc\", then both\n"
+ " \"precompiled_header\" and \"precompiled_source\" must resolve\n"
+ " to the same file, despite the different formats required for each."
"\n"
" See \"gn help precompiled_header\" for more.\n"
"\n"
« no previous file with comments | « tools/gn/config_values_generator.h ('k') | tools/gn/ninja_binary_target_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698