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

Unified Diff: tools/gn/docs/reference.md

Issue 2514333005: Add support for customizing GN's args text. (Closed)
Patch Set: update docs Created 3 years, 10 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/command_args.cc ('k') | tools/gn/setup.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/docs/reference.md
diff --git a/tools/gn/docs/reference.md b/tools/gn/docs/reference.md
index 97a2c866fc849f67206cb0f78f4e53da26e7db26..db5c34172119b865768d4b6f445f6cd7a2bf7b90 100644
--- a/tools/gn/docs/reference.md
+++ b/tools/gn/docs/reference.md
@@ -3893,7 +3893,7 @@
This should be set to the most specific value possible. So, "android" or
"chromeos" should be used instead of "linux" where applicable, even though
- Android and Chrome OS are both Linux variants. This can mean that one needs to
+ Android and ChromeOS are both Linux variants. This can mean that one needs to
write
if (target_os == "android" || target_os == "linux") {
@@ -5307,12 +5307,28 @@
config applying to this target specifies this value. In addition, the tool
corresponding to the source files must also specify precompiled headers (see
"gn help tool"). The tool will also specify what type of precompiled headers
- to use.
+ to use, by setting precompiled_header_type to either "gcc" or "msvc".
The precompiled header/source variables can be specified on a target or a
config, but must be the same for all configs applying to a given target since
a target can only have one precompiled header.
+ If you use both C and C++ sources, the precompiled header and source file
+ will be compiled once per language. You will want to make sure to wrap C++
+ includes in __cplusplus #ifdefs so the file will compile in C mode.
+
+```
+
+### **GCC precompiled headers**
+
+```
+ When using GCC-style precompiled headers, "precompiled_source" contains the
+ path of a .h file that is precompiled and then included by all source files
+ in targets that set "precompiled_source".
+
+ The value of "precompiled_header" is not used with GCC-style precompiled
+ headers.
+
```
### **MSVC precompiled headers**
@@ -5320,8 +5336,8 @@
```
When using MSVC-style precompiled headers, the "precompiled_header" value is
a string corresponding to the header. This is NOT a path to a file that GN
- recognises, but rather the exact string that appears in quotes after an
- #include line in source code. The compiler will match this string against
+ recognises, but rather the exact string that appears in quotes after
+ an #include line in source code. The compiler will match this string against
includes or forced includes (/FI).
MSVC also requires a source file to compile the header with. This must be
@@ -5329,10 +5345,6 @@
this IS a GN-style file name, and tells GN which source file to compile to
make the .pch file used for subsequent compiles.
- If you use both C and C++ sources, the precompiled header and source file
- will be compiled using both tools. You will want to make sure to wrap C++
- includes in __cplusplus #ifdefs so the file will compile in C mode.
-
For example, if the toolchain specifies MSVC headers:
toolchain("vc_x64") {
@@ -5360,6 +5372,13 @@
```
+## **precompiled_header_type**: [string] "gcc" or "msvc".
+
+```
+ See "gn help precompiled_header".
+
+
+```
## **precompiled_source**: [file name] Source file to precompile.
```
@@ -5796,8 +5815,12 @@
### **Variables**
```
+ arg_file_template [optional]
+ Path to a file containing the text that should be used as the default
+ args.gn content when you run `gn args`.
+
buildconfig [required]
- Label of the build config file. This file will be used to set up the
+ Path to the build config file. This file will be used to set up the
build file execution environment for each toolchain.
check_targets [optional]
« no previous file with comments | « tools/gn/command_args.cc ('k') | tools/gn/setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698