diff options
author | andybons <andybons@chromium.org> | 2015-08-30 19:27:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-31 02:28:22 +0000 |
commit | ad92aa35752c2a1f3a0faad364f9b2d1cef83b91 (patch) | |
tree | 443feee4987dc2390dbceedd3a292a276700b5c7 /docs/ninja_build.md | |
parent | 22afb31800284923e9f84af6373f68ad6b241f4b (diff) | |
download | chromium_src-ad92aa35752c2a1f3a0faad364f9b2d1cef83b91.zip chromium_src-ad92aa35752c2a1f3a0faad364f9b2d1cef83b91.tar.gz chromium_src-ad92aa35752c2a1f3a0faad364f9b2d1cef83b91.tar.bz2 |
[Docs] Another round of stylistic fixes.
TBR=nodir
BUG=524256
Review URL: https://codereview.chromium.org/1324603002
Cr-Commit-Position: refs/heads/master@{#346335}
Diffstat (limited to 'docs/ninja_build.md')
-rw-r--r-- | docs/ninja_build.md | 81 |
1 files changed, 53 insertions, 28 deletions
diff --git a/docs/ninja_build.md b/docs/ninja_build.md index addf61d..0a32853 100644 --- a/docs/ninja_build.md +++ b/docs/ninja_build.md @@ -1,10 +1,15 @@ +# Ninja Build +Ninja is a build system written with the specific goal of improving the +edit-compile cycle time. It is used by default everywhere except when building +for iOS. -Ninja is a build system written with the specific goal of improving the edit-compile cycle time. It is used by default everywhere except when building for iOS. +Ninja behaves very similar to Make -- the major feature is that it starts +building files nearly instantly. (It has a number of minor user interface +improvements to make as well.) -Ninja behaves very similar to Make -- the major feature is that it starts building files nearly instantly. (It has a number of minor user interface improvements to make as well.) - -Read more about Ninja at [the Ninja home page](http://martine.github.com/ninja/). +Read more about Ninja at +[the Ninja home page](http://martine.github.com/ninja/). ## Using it @@ -12,68 +17,88 @@ Read more about Ninja at [the Ninja home page](http://martine.github.com/ninja/) #### Install -Ninja is included in depot\_tools as well as gyp, so there's nothing to install. +Ninja is included in `depot_tools` as well as `gyp`, so there's nothing to +install. ## Build instructions To build Chrome: -``` -cd /path/to/chrome/src -ninja -C out/Debug chrome -``` -Specify `out/Release` for a release build. I recommend setting up an alias so that you don't need to type out that build directory path. + cd /path/to/chrome/src + ninja -C out/Debug chrome -If you want to build all targets, use `ninja -C out/Debug all`. It's faster to build only the target you're working on, like 'chrome' or 'unit\_tests'. +Specify `out/Release` for a release build. I recommend setting up an alias so +that you don't need to type out that build directory path. + +If you want to build all targets, use `ninja -C out/Debug all`. It's faster to +build only the target you're working on, like `chrome` or `unit_tests`. ## Android -Identical to Linux, just make sure `OS=android` is in your `GYP_DEFINES`. You want to build one of the _apk targets, e.g. `content_shell_apk`._ +Identical to Linux, just make sure `OS=android` is in your `GYP_DEFINES`. You +want to build one of the apk targets, e.g. `content_shell_apk`. ## Windows -Similar to Linux. It uses MSVS's `cl.exe`, `link.exe`, etc. so you still need to have VS installed. To use it, open `cmd.exe`, go to your chrome checkout, and run: -``` -set GYP_DEFINES=component=shared_library -python build\gyp_chromium -ninja -C out\Debug chrome.exe -``` +Similar to Linux. It uses MSVS's `cl.exe`, `link.exe`, etc. so you still need to +have VS installed. To use it, open `cmd.exe`, go to your chrome checkout, and +run: -`component=shared_library` optional but recommended for faster links. + set GYP_DEFINES=component=shared_library + python build\gyp_chromium + ninja -C out\Debug chrome.exe -You can also set `GYP_GENERATORS=ninja,msvs-ninja` to get both VS projects generated if you want to use VS just to browse/edit (but then gyp takes twice as long to run). +`component=shared_library` is optional but recommended for faster links. -If you're using Express or the Windows SDK by itself (rather than using a Visual Studio install), you'll need to run from a vcvarsall command prompt. +You can also set `GYP_GENERATORS=ninja,msvs-ninja` to get both VS projects +generated if you want to use VS just to browse/edit (but then gyp takes twice as +long to run). + +If you're using Express or the Windows SDK by itself (rather than using a Visual +Studio install), you'll need to run from a vcvarsall command prompt. ### Debugging Miss VS for debugging? + ``` devenv.com /debugexe chrome.exe --my-great-args "go here" --single-process etc ``` -Miss Xcode for debugging? Read http://dev.chromium.org/developers/debugging-on-os-x/building-with-ninja-debugging-with-xcode +Miss Xcode for debugging? Read +http://dev.chromium.org/developers/debugging-on-os-x/building-with-ninja-debugging-with-xcode ### Without Visual Studio -That is, building with just the WinDDK. This is documented in the [regular build instructions](http://dev.chromium.org/developers/how-tos/build-instructions-windows#TOC-Setting-up-the-environment-for-building-with-Visual-C-2010-Express-or-Windows-7.1-SDK). +That is, building with just the WinDDK. This is documented in the +[regular build instructions](http://dev.chromium.org/developers/how-tos/build-instructions-windows#TOC-Setting-up-the-environment-for-building-with-Visual-C-2010-Express-or-Windows-7.1-SDK). ## Tweaks ### Building through errors -Pass a flag like `-k3` to make Ninja build until it hits three errors instead of stopping at the first. + +Pass a flag like `-k3` to make Ninja build until it hits three errors instead of +stopping at the first. ### Parallelism -Pass a flag like `-j8` to use 8 parallel processes, or `-j1` to compile just one at a time (helpful if you're getting weird compiler errors). By default Ninja tries to use all your processors. + +Pass a flag like `-j8` to use 8 parallel processes, or `-j1` to compile just one +at a time (helpful if you're getting weird compiler errors). By default Ninja +tries to use all your processors. ### More options + There are more options. Run `ninja --help` to see them all. ### Custom build configs -You can write a specific build config to a specific output directory via the `-G` flags to gyp. Here's an example from jamesr: -`build/gyp_chromium -Gconfig=Release -Goutput_dir=out_profiling -Dprofiling=1 -Dlinux_fpic=0` +You can write a specific build config to a specific output directory via the +`-G` flags to gyp. Here's an example from jamesr: +`build/gyp_chromium -Gconfig=Release -Goutput_dir=out_profiling -Dprofiling=1 +-Dlinux_fpic=0` ## Bugs -If you encounter any problems, please file a bug at http://crbug.com/new with label `ninja` and cc `thakis@` or `scottmg@`. Assume that it is a bug in Ninja before you bother anyone about e.g. link problems.
\ No newline at end of file +If you encounter any problems, please file a bug at http://crbug.com/new with +label `ninja` and cc `thakis@` or `scottmg@`. Assume that it is a bug in Ninja +before you bother anyone about e.g. link problems. |