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

Unified Diff: docs/common_build_tasks.md

Issue 1314513007: [Docs]: Update to match style guide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes 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 | « docs/android_test_instructions.md ('k') | docs/cr_user_manual.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/common_build_tasks.md
diff --git a/docs/common_build_tasks.md b/docs/common_build_tasks.md
index 43ac2d8be51a7c6e87c7eddb600c4c7b6f555889..c456dbd3150825d97c5b22c65b6de3273d6eca9e 100644
--- a/docs/common_build_tasks.md
+++ b/docs/common_build_tasks.md
@@ -1,18 +1,26 @@
-The Chromium build system is a complicated beast of a system, and it is not very well documented beyond the basics of getting the source and building the Chromium product. This page has more advanced information about the build system.
+# Common Build Tasks
-If you're new to Chromium development, read the [getting started guides](http://dev.chromium.org/developers/how-tos/get-the-code).
+The Chromium build system is a complicated beast of a system, and it is not very
+well documented beyond the basics of getting the source and building the
+Chromium product. This page has more advanced information about the build
+system.
+If you're new to Chromium development, read the
+[getting started guides](http://dev.chromium.org/developers/how-tos/get-the-code).
+[TOC]
-# Faster Builds
+## Faster Builds
-## Components Build
+### Components Build
-A non-standard build configuration is to use dynamic linking instead of static linking for the various modules in the Chromium codebase. This results in significantly faster link times, but is a divergence from what is shipped and primarily tested. To enable the [component build](http://www.chromium.org/developers/how-tos/component-build):
+A non-standard build configuration is to use dynamic linking instead of static
+linking for the various modules in the Chromium codebase. This results in
+significantly faster link times, but is a divergence from what is shipped and
+primarily tested. To enable the
+[component build](http://www.chromium.org/developers/how-tos/component-build):
-```
-$ GYP_DEFINES="component=shared_library" gclient runhooks
-```
+ $ GYP_DEFINES="component=shared_library" gclient runhooks
or
@@ -21,36 +29,40 @@ C:\...\src>set GYP_DEFINES=component=shared_library
C:\...\src>gclient runhooks
```
+### Windows: Debug Builds Link Faster
-## Windows: Debug Builds Link Faster
+On Windows if using the components build, building in debug mode will generally
+link faster. This is because in debug mode, the linker works incrementally. In
+release mode, a full link is performed each time.
-On Windows if using the components build, building in debug mode will generally link faster. This is because in debug mode, the linker works incrementally. In release mode, a full link is performed each time.
+### Mac: Disable Release Mode Stripping
-## Mac: Disable Release Mode Stripping
+On Mac, if building in release mode, one of the final build steps will be to
+strip the build products and create dSYM files. This process can slow down your
+incremental builds, but it can be disabled with the following define:
-On Mac, if building in release mode, one of the final build steps will be to strip the build products and create dSYM files. This process can slow down your incremental builds, but it can be disabled with the following define:
+ $ GYP_DEFINES="mac_strip_release=0" gclient runhooks
-```
-$ GYP_DEFINES="mac_strip_release=0" gclient runhooks
-```
+### Mac: DCHECKs in Release Mode
-## Mac: DCHECKs in Release Mode
+DCHECKs are only designed to be run in debug builds. But building in release
+mode on Mac is significantly faster. You can have your cake and eat it too by
+building release mode with DCHECKs enabled using the following define:
-DCHECKs are only designed to be run in debug builds. But building in release mode on Mac is significantly faster. You can have your cake and eat it too by building release mode with DCHECKs enabled using the following define:
+ $ GYP_DEFINES="dcheck_always_on=1" gclient runhooks
-```
-$ GYP_DEFINES="dcheck_always_on=1" gclient runhooks
-```
+### Linux
-## Linux
+Linux has its own page on [making the build faster](linux_faster_builds.md).
-Linux has its own page on [making the build faster](https://code.google.com/p/chromium/wiki/LinuxFasterBuilds).
+## Configuring the Build
-# Configuring the Build
+### Environment Variables
-## Environment Variables
+There are various environment variables that can be passed to the metabuild
+system GYP when generating project files. This is a summary of them:
-There are various environment variables that can be passed to the metabuild system GYP when generating project files. This is a summary of them:
+TODO(andybons): Convert to list.
| GYP\_DEFINES | A set of key=value pairs separated by space that will set default values of variables used in .gyp and .gypi files |
|:-------------|:-------------------------------------------------------------------------------------------------------------------|
@@ -58,73 +70,84 @@ There are various environment variables that can be passed to the metabuild syst
| GYP\_GENERATOR\_FLAGS | Flags that are passed down to the tool that generates the build-system specific files |
| GYP\_GENERATOR\_OUTPUT | The directory that the top-level build output directory is relative to |
-Note also that GYP uses CPPFLAGS, CFLAGS, and CXXFLAGS when generating ninja files (the values at build time = ninja run time are _not_ used); see [gyp/generator/ninja.py](https://code.google.com/p/chromium/codesearch#chromium/src/tools/gyp/pylib/gyp/generator/ninja.py&q=cxxflags).
+Note also that GYP uses CPPFLAGS, CFLAGS, and CXXFLAGS when generating ninja
+files (the values at build time = ninja run time are _not_ used); see
+[gyp/generator/ninja.py](https://code.google.com/p/chromium/codesearch#chromium/src/tools/gyp/pylib/gyp/generator/ninja.py&q=cxxflags).
-## Variable Files
+### Variable Files
-If you want to keep a set of variables established, there are a couple of magic files that GYP reads:
+If you want to keep a set of variables established, there are a couple of magic
+files that GYP reads:
-### chromium.gyp\_env
+#### chromium.gyp\_env
-Next to your top-level `/src/` directory, create a file called `chromium.gyp_env`. This holds a JSON dictionary, with the keys being any of the above environment variables. For the full list of supported keys, see [/src/build/gyp\_helper.py](https://code.google.com/p/chromium/codesearch#chromium/src/build/gyp_helper.py&sq=package:chromium&type=cs&q=file:gyp_helper.py%5Cb).
+Next to your top-level `/src/` directory, create a file called
+`chromium.gyp_env`. This holds a JSON dictionary, with the keys being any of the
+above environment variables. For the full list of supported keys, see
+[/src/build/gyp_helper.py](/build/gyp_helper.py).
-```
-{
+``` {
'variables': {
'mac_strip_release': 0,
- },
- 'GYP_DEFINES':
- 'clang=1 '
- 'component=shared_library '
- 'dcheck_always_on=1 '
-}
-```
+ }, 'GYP_DEFINES':
+ 'clang=1 ' 'component=shared_library ' 'dcheck_always_on=1 '
+} ```
-
-### include.gyp
+#### include.gyp
Or globally in your home directory, create a file `~/.gyp/include.gypi`.
-### supplement.gypi
+#### supplement.gypi
-The build system will also include any files named `/src/*/supplement.gypi`, which should be in the same format as include.gyp above.
+The build system will also include any files named `/src/*/supplement.gypi`,
+which should be in the same format as include.gyp above.
-## Change the Build System
+### Change the Build System
-Most platforms support multiple build systems (Windows: different Visual Studios versions and ninja, Mac: Xcode and ninja, etc.). A sensible default is selected, but it can be overridden:
+Most platforms support multiple build systems (Windows: different Visual Studios
+versions and ninja, Mac: Xcode and ninja, etc.). A sensible default is selected,
+but it can be overridden:
-```
-$ GYP_GENERATORS=ninja gclient runhooks
-```
+ $ GYP_GENERATORS=ninja gclient runhooks
-[Ninja](https://code.google.com/p/chromium/wiki/NinjaBuild) is generally the fastest way to build anything on any platform.
+[Ninja](ninja_build.md) is generally the fastest way to build anything on any
+platform.
-## Change Build Output Directory
+### Change Build Output Directory
-If you need to change a compile-time flag and do not want to touch your current build output, you can re-run GYP and place output into a new directory, like so, assuming you are using ninja:
+If you need to change a compile-time flag and do not want to touch your current
+build output, you can re-run GYP and place output into a new directory, like so,
+assuming you are using ninja:
-```
+```shell
$ GYP_GENERATOR_FLAGS="output_dir=out_other_ninja" gclient runhooks
$ ninja -C out_other_ninja/Release chrome
```
-Alternatively, you can do the following, which should work with all GYP generators, but the out directory is nested as `out_other/out/`.
+Alternatively, you can do the following, which should work with all GYP
+generators, but the out directory is nested as `out_other/out/`.
-```
+```shell
$ GYP_GENERATOR_OUTPUT="out_other" gclient runhooks
$ ninja -C out_other/out/Release chrome
```
-**Note:** If you wish to run the WebKit layout tests, make sure you specify the new directory using `--build-directory=out_other_ninja` (don't include the `Release` part).
+**Note:** If you wish to run the WebKit layout tests, make sure you specify the
+new directory using `--build-directory=out_other_ninja` (don't include the
+`Release` part).
-## Building Google Chrome
+### Building Google Chrome
-To build Chrome, you need to be a Google employee and have access to the [src-internal](http://go.ext.google.com/src-internal) repository. Once your checkout is set up, you can run gclient like so:
+To build Chrome, you need to be a Google employee and have access to the
+[src-internal](https://goto.google.com/src-internal) repository. Once your
+checkout is set up, you can run gclient like so:
-```
-$ GYP_DEFINES="branding=Chrome buildtype=Official" gclient runhooks
-```
+ $ GYP_DEFINES="branding=Chrome buildtype=Official" gclient runhooks
-Then building the `chrome` target will produce the official build. This tip can be used in conjunction with changing the output directory, since changing these defines will rebuild the world.
+Then building the `chrome` target will produce the official build. This tip can
+be used in conjunction with changing the output directory, since changing these
+defines will rebuild the world.
-Also note that some GYP\_DEFINES flags are incompatible with the official build. If you get an error when you try to build, try removing all your flags and start with just the above ones.
+Also note that some GYP\_DEFINES flags are incompatible with the official build.
+If you get an error when you try to build, try removing all your flags and start
+with just the above ones.
« no previous file with comments | « docs/android_test_instructions.md ('k') | docs/cr_user_manual.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698