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

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: switch statement. error handling. some initial docs. Created 5 years, 4 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 | « no previous file | tools/gn/ninja_binary_target_writer.h » ('j') | tools/gn/ninja_binary_target_writer.cc » ('J')
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 2fe5f53a23c5135918262ed2b0a7cea3f9fa7378..d2cc9fcb603611e106acfd0de63bca80d85beb7d 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;
}
@@ -527,12 +530,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 | « no previous file | tools/gn/ninja_binary_target_writer.h » ('j') | tools/gn/ninja_binary_target_writer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698