Commit 1a70d0c9 authored by dpranke's avatar dpranke Committed by Commit bot

More fixes to the build instructions.

This picks up various fixes noted by scottmg@chromium.org,
thakis@chromium.org, and Twitter user @florpelier, as well as a few
more things I wanted to clean up.

R=scottmg@chromium.org, thakis@chromium.org, sdy@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2543503004
Cr-Commit-Position: refs/heads/master@{#435533}
parent a237428c
# Android Build Instructions # Checking out and building Chromium for Android
There are instructions for other platforms linked from the
[get the code](get_the_code.md) page.
**See also [the old version of this page](old_android_build_instructions.md).** **See also [the old version of this page](old_android_build_instructions.md).**
## Instructions for Google Employees
Are you a Google employee? See
[go/building-chrome](https://goto.google.com/building-chrome) instead.
Google employee? See [go/building-chrome](https://goto.google.com/building-chrome) instead. Google employee? See [go/building-chrome](https://goto.google.com/building-chrome) instead.
[TOC] [TOC]
...@@ -121,7 +128,7 @@ $ sudo update-alternatives --config jar ...@@ -121,7 +128,7 @@ $ sudo update-alternatives --config jar
$ sudo update-alternatives --config jarsigner $ sudo update-alternatives --config jarsigner
``` ```
## Setting up the Build ## Setting up the build
Chromium uses [Ninja](https://ninja-build.org) as its main build tool along Chromium uses [Ninja](https://ninja-build.org) as its main build tool along
with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja` with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja`
......
...@@ -10,8 +10,8 @@ all over the place, we have a self-contained page for each configuration ...@@ -10,8 +10,8 @@ all over the place, we have a self-contained page for each configuration
you might want to build: you might want to build:
* [Android](android_build_instructions.md) * [Android](android_build_instructions.md)
* [Cast](cast_build_instructions.md) * [Cast](old_cast_build_instructions.md)
* [ChromeOS](chromeos_build_instructions.md) * [ChromeOS](old_chromeos_build_instructions.md)
* [iOS](ios_build_instructions.md) * [iOS](ios_build_instructions.md)
* [Linux](linux_build_instructions.md) * [Linux](linux_build_instructions.md)
* [Mac](mac_build_instructions.md) * [Mac](mac_build_instructions.md)
......
# iOS Build Instructions # Checking out and building Chromium for iOS
There are instructions for other platforms linked from the
[get the code](get_the_code.md) page.
**See also [the old version of this page](old_ios_build_instructions.md).** **See also [the old version of this page](old_ios_build_instructions.md).**
## Instructions for Google Employees
Are you a Google employee? See
[go/building-chrome](https://goto.google.com/building-chrome) instead.
Google employee? See [go/building-chrome](https://goto.google.com/building-chrome) instead. Google employee? See [go/building-chrome](https://goto.google.com/building-chrome) instead.
[TOC] [TOC]
...@@ -101,7 +108,7 @@ You can also follow the manual instructions on the ...@@ -101,7 +108,7 @@ You can also follow the manual instructions on the
[Mac page](mac_build_instructions.md), but make sure you set the [Mac page](mac_build_instructions.md), but make sure you set the
GN arg `target_os="ios"`. GN arg `target_os="ios"`.
## Running ## Running `ios_web_shell`
Any target that is built and runs on the bots (see [below](#Troubleshooting)) Any target that is built and runs on the bots (see [below](#Troubleshooting))
should run successfully in a local build. As of the time of writing, this is should run successfully in a local build. As of the time of writing, this is
......
# Checking out and building Chromium on Linux # Checking out and building Chromium on Linux
There are instructions for other platforms linked from the
[get the code](get_the_code.md) page.
**See also [the old version of this page](old_linux_build_instructions.md).** **See also [the old version of this page](old_linux_build_instructions.md).**
Google employee? See [go/building-chrome](https://goto.google.com/building-chrome) instead. ## Instructions for Google Employees
Are you a Google employee? See
[go/building-chrome](https://goto.google.com/building-chrome) instead.
[TOC] [TOC]
...@@ -97,7 +103,7 @@ keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your ...@@ -97,7 +103,7 @@ keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
build to talk to some Google services, but this is not necessary for most build to talk to some Google services, but this is not necessary for most
development and testing purposes. development and testing purposes.
## Setting up the Build ## Setting up the build
Chromium uses [Ninja](https://ninja-build.org) as its main build tool along Chromium uses [Ninja](https://ninja-build.org) as its main build tool along
with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja` with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja`
...@@ -151,7 +157,7 @@ You can run the tests in the same way. You can also limit which tests are ...@@ -151,7 +157,7 @@ You can run the tests in the same way. You can also limit which tests are
run using the `--gtest_filter` arg, e.g.: run using the `--gtest_filter` arg, e.g.:
```shell ```shell
$ ninja -C out/Default unit_tests --gtest_filter="PushClientTest.*" $ out/Default/unit_tests --gtest_filter="PushClientTest.*"
``` ```
You can find out more about GoogleTest at its You can find out more about GoogleTest at its
......
# Mac Build Instructions # Checking out and building Chromium for Mac
Google employee? See [go/building-chrome](https://goto.google.com/building-chrome) instead. There are instructions for other platforms linked from the
[get the code](get_the_code.md) page.
**See also [the old version of this page](old_mac_build_instructions.md).**
## Instructions for Google Employees
Are you a Google employee? See
[go/building-chrome](https://goto.google.com/building-chrome) instead.
[TOC] [TOC]
...@@ -69,7 +77,7 @@ keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your ...@@ -69,7 +77,7 @@ keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
build to talk to some Google services, but this is not necessary for most build to talk to some Google services, but this is not necessary for most
development and testing purposes. development and testing purposes.
## Building ## Setting up the build
Chromium uses [Ninja](https://ninja-build.org) as its main build tool along Chromium uses [Ninja](https://ninja-build.org) as its main build tool along
with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja` with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja`
...@@ -128,6 +136,19 @@ in gdb). ...@@ -128,6 +136,19 @@ in gdb).
You might also want to [install ccache](ccache_mac.md) to speed up the build. You might also want to [install ccache](ccache_mac.md) to speed up the build.
## Build Chromium
Build Chromium (the "chrome" target) with Ninja using the command:
```shell
$ ninja -C out/Default chrome
```
You can get a list of all of the other build targets from GN by running `gn ls
out/Default` from the command line. To compile one, pass the GN label to Ninja
with no preceding "//" (so, for `//chrome/test:unit_tests` use `ninja -C
out/Default chrome/test:unit_tests`).
## Run Chromium ## Run Chromium
Once it is built, you can simply run the browser: Once it is built, you can simply run the browser:
...@@ -142,7 +163,7 @@ You can run the tests in the same way. You can also limit which tests are ...@@ -142,7 +163,7 @@ You can run the tests in the same way. You can also limit which tests are
run using the `--gtest_filter` arg, e.g.: run using the `--gtest_filter` arg, e.g.:
``` ```
$ ninja -C out/Default unit_tests --gtest_filter="PushClientTest.*" $ out/Default/unit_tests --gtest_filter="PushClientTest.*"
``` ```
You can find out more about GoogleTest at its You can find out more about GoogleTest at its
......
# Checking out and building Chromium on Windows # Checking out and Building Chromium for Windows
There are instructions for other platforms linked from the
[get the code](get_the_code.md) page.
**See also [the old version of this page](old_linux_build_instructions.md).** **See also [the old version of this page](old_linux_build_instructions.md).**
Google employee? See [go/building-chrome](https://goto.google.com/building-chrome) instead. ## Instructions for Google Employees
Are you a Google employee? See
[go/building-chrome](https://goto.google.com/building-chrome) instead.
[TOC] [TOC]
...@@ -16,12 +22,6 @@ Google employee? See [go/building-chrome](https://goto.google.com/building-chrom ...@@ -16,12 +22,6 @@ Google employee? See [go/building-chrome](https://goto.google.com/building-chrom
## Setting up Windows ## Setting up Windows
### System locale
You must set your Windows system locale to English, or else you may get
build errors about "The file contains a character that cannot be
represented in the current code page."
### Visual Studio ### Visual Studio
As of March 11, 2016 Chromium requires Visual Studio 2015 to build. As of March 11, 2016 Chromium requires Visual Studio 2015 to build.
...@@ -37,12 +37,12 @@ and select: ...@@ -37,12 +37,12 @@ and select:
You must have the 10586 SDK installed or else you will hit compile errors such You must have the 10586 SDK installed or else you will hit compile errors such
as redefined macros. as redefined macros.
Install Windows Driver Kit (WDK) 10, or use some other method to get the Install the Windows SDK 10, and choose Debugging Tools For Windows when you
Debugging Tools for Windows. install this in order to get windbg.
## Install `depot_tools` ## Install `depot_tools`
Download the (depot_tools bundle)[https://storage.googleapis.com/chrome-infra/depot_tools.zip] Download the [depot_tools bundle](https://storage.googleapis.com/chrome-infra/depot_tools.zip)
and extract it somewhere. and extract it somewhere.
*** note *** note
...@@ -65,7 +65,8 @@ Without Administrator access: ...@@ -65,7 +65,8 @@ Without Administrator access:
Control Panel → User Accounts → User Accounts → Change my environment variables Control Panel → User Accounts → User Accounts → Change my environment variables
Add a PATH user variable: C:\src\depot_tools;%PATH%. Add a PATH user variable (or modify the existing one to include):
`C:\src\depot_tools`.
Also, add a DEPOT_TOOLS_WIN_TOOLCHAIN system variable in the same way, and set Also, add a DEPOT_TOOLS_WIN_TOOLCHAIN system variable in the same way, and set
it to 0. This tells depot_tools to use your locally installed version of Visual it to 0. This tells depot_tools to use your locally installed version of Visual
...@@ -122,7 +123,7 @@ keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your ...@@ -122,7 +123,7 @@ keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
build to talk to some Google services, but this is not necessary for most build to talk to some Google services, but this is not necessary for most
development and testing purposes. development and testing purposes.
## Building ## Setting up the build
Chromium uses [Ninja](https://ninja-build.org) as its main build tool along Chromium uses [Ninja](https://ninja-build.org) as its main build tool along
with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja` with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja`
...@@ -151,8 +152,9 @@ argument to `gn gen` when you generate your output directory (as described on ...@@ -151,8 +152,9 @@ argument to `gn gen` when you generate your output directory (as described on
the [get the code](http://dev.chromium.org/developers/how-tos/get-the-code) the [get the code](http://dev.chromium.org/developers/how-tos/get-the-code)
page): page):
```gn gen --ide=vs out\Default ```shell
devenv out\Default\all.sln $ gn gen --ide=vs out\Default
$ devenv out\Default\all.sln
``` ```
GN will produce a file `all.sln` in your build directory. It will internally GN will produce a file `all.sln` in your build directory. It will internally
...@@ -167,7 +169,9 @@ for only the code you're interested in, although this will also limit what ...@@ -167,7 +169,9 @@ for only the code you're interested in, although this will also limit what
files appear in the project explorer. A minimal solution that will let you files appear in the project explorer. A minimal solution that will let you
compile and run Chrome in the IDE but will not show any source files is: compile and run Chrome in the IDE but will not show any source files is:
```gn gen --ide=vs --filters=//chrome out\Default``` ```
$ gn gen --ide=vs --filters=//chrome out\Default
```
There are other options for controlling how the solution is generated, run `gn There are other options for controlling how the solution is generated, run `gn
help gen` for the current documentation. help gen` for the current documentation.
...@@ -185,7 +189,9 @@ be recompiled. ...@@ -185,7 +189,9 @@ be recompiled.
Build Chromium (the "chrome" target) with Ninja using the command: Build Chromium (the "chrome" target) with Ninja using the command:
$ ninja -C out\Default chrome ```shell
$ ninja -C out\Default chrome
```
You can get a list of all of the other build targets from GN by running You can get a list of all of the other build targets from GN by running
`gn ls out/Default` from the command line. To compile one, pass to Ninja `gn ls out/Default` from the command line. To compile one, pass to Ninja
...@@ -196,14 +202,20 @@ use ninja -C out/Default chrome/test:unit_tests`). ...@@ -196,14 +202,20 @@ use ninja -C out/Default chrome/test:unit_tests`).
Once it is built, you can simply run the browser: Once it is built, you can simply run the browser:
$ out\Default\chrome.exe ```shell
$ out\Default\chrome.exe
```
(The ".exe" suffix in the command is actually optional).
## Running test targets ## Running test targets
You can run the tests in the same way. You can also limit which tests are You can run the tests in the same way. You can also limit which tests are
run using the `--gtest_filter` arg, e.g.: run using the `--gtest_filter` arg, e.g.:
$ ninja -C out\Default unit_tests --gtest_filter="PushClientTest.*" ```shell
$ out\Default\unit_tests.exe --gtest_filter="PushClientTest.*"
```
You can find out more about GoogleTest at its You can find out more about GoogleTest at its
[GitHub page](https://github.com/google/googletest). [GitHub page](https://github.com/google/googletest).
...@@ -212,8 +224,10 @@ You can find out more about GoogleTest at its ...@@ -212,8 +224,10 @@ You can find out more about GoogleTest at its
To update an existing checkout, you can run To update an existing checkout, you can run
$ git rebase-update ```shell
$ gclient sync $ git rebase-update
$ gclient sync
```
The first command updates the primary Chromium source repository and rebases The first command updates the primary Chromium source repository and rebases
any of your local branches on top of tip-of-tree (aka the Git branch `origin/master`). any of your local branches on top of tip-of-tree (aka the Git branch `origin/master`).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment