blob: 2793782cbb12276cf7304febd8dbedfa48e6369c [file] [log] [blame] [view]
tfarina502f3882016-03-23 12:48:101# Windows Build Instructions
2
3## Setting up Windows
4
5You must set your Windows system locale to English, or else you may get
6build errors about "The file contains a character that cannot be
7represented in the current code page."
8
9### Setting up the environment for Visual Studio
10
11You must build with Visual Studio 2013 Update 4 or Visual Studio 2015
12Update 1, no other versions are supported.
13
14You must have Windows 7 x64 or later. x86 OSs are unsupported.
15
161. Get
17[depot\_tools](http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up).
182. Follow the appropriate path below:
19
20### Open source contributors
21
22For building with Visual Studio 2015 (default compiler as of March 10,
232016):
24
25> Install Visual Studio 2015 Update 1 or later - Community Edition
26> should work if its license is appropriate for you. Be sure to select
27> Custom install and select VC++ (which selects three sub-categories
28> including MFC) and, under Universal Windows App Development Tools,
29> select Tools (1.2) and Windows 10 SDK (10.0.10586). You must have the
30> 10586 SDK installed or else you will hit compile errors such as
31> redefined macros.
32
33For building with Visual Studio 2013 (no longer default as of March 10,
342016, and not recommended - requires setting GYP\_MSVS\_VERSION=2013):
35
36> Install [Visual Studio 2013
37> Community](http://www.visualstudio.com/products/visual-studio-community-vs)
38> or [Visual Studio 2013
39> Professional](http://www.visualstudio.com/products/visual-studio-professional-with-msdn-vs)
40> depending on which license is appropriate for you. You can deselect
41> the default options if you want, but you must make sure to install
42> "Microsoft Foundation Classes for C++".
43> \
44> You should also install the [Windows 10
45> SDK](https://dev.windows.com/en-us/downloads/windows-10-sdk) to the
46> default install location. You must have SDK version 10.0.10586 or
47> greater installed.
48
49Run `set DEPOT\_TOOLS\_WIN\_TOOLCHAIN=0`, or set that variable in your
50global environment.
51
52Visual Studio Express 2013 is **not** supported and will not be able to
53build Chromium.
54
55Compilation is done through ninja, **not** Visual Studio.
56
57### Google employees
58
59Run: `download\_from\_google\_storage --config` and follow the
60authentication instructions.**Note that you must authenticate with your
61@google.com credentials**, not @chromium.org. Enter "0" if asked for a
62project-id.
63
64Once you've done this, the toolchain will be installed automatically for
65you in Step 3, below (near the end of the step).
66
67The toolchain will be in depot\_tools\\win\_toolchain, and windbg can be
68found in
69depot\_tools\\win\_toolchain\\vs2013\_files\\win8sdk\\Debuggers.
70
71If you want the IDE for debugging and editing, you will need to install
72it separately, but this is optional and not needed to build Chromium.
73
74## Getting the Code
75
76Follow the steps to [check out the
77code](https://www.chromium.org/developers/how-tos/get-the-code) (largely
78"fetch chromium").
79
80## Building
81
82Build the target you are interested in.
83
84```shell
85ninja -C out\\Debug chrome
86```
87
88Alternative (Graphical user interface): Open a generated .sln
89file such as all.sln, right-click the chrome project and select build.
90This will invoke the real step 4 above. Do not build the whole solution
91since that conflicts with ninja's build management and everything will
92explode.
93Substitute the build directory given to -C with out\\Debug\_x64 for
94[64-bit
95builds](https://www.chromium.org/developers/design-documents/64-bit-support)
96in GYP, or whatever build directory you have configured if using GN.
97
98### Performance tips
99
1001. Have many and fast CPU cores and enough RAM to keep them all busy.
101 (Minimum recommended is 4-8 fast cores and 16-32 GB of RAM)
1022. Reduce file system overhead by excluding build directories from
103 antivirus and indexing software.
1043. Store the build tree on a fast disk (preferably SSD).
1054. If you are primarily going to be doing debug development builds, you
106 use the component build (in
107 [GYP](https://www.chromium.org/developers/gyp-environment-variables)
108 do set GYP\_DEFINES=component=shared\_library, in
109 [GN](https://www.chromium.org/developers/gn-build-configuration),
110 set the build arg is\_component\_build = true). This will generate
111 many DLLs and enable incremental linking, which makes linking
112 *much*faster in Debug.
113
114Still expect build times of 30 minutes to 2 hours when everything has to
115be recompiled.