| OLD | NEW |
| (Empty) |
| 1 # Windows Build Instructions | |
| 2 | |
| 3 **Generally, this page is obsolete and you should look at | |
| 4 [the new page instead](windows_build_instructions.md).** | |
| 5 | |
| 6 ## Common checkout instructions | |
| 7 | |
| 8 This page covers Windows-specific setup and configuration. The | |
| 9 [general checkout | |
| 10 instructions](http://dev.chromium.org/developers/how-tos/get-the-code) cover | |
| 11 installing depot tools and checking out the code via git. | |
| 12 | |
| 13 ## Setting up Windows | |
| 14 | |
| 15 You must set your Windows system locale to English, or else you may get | |
| 16 build errors about "The file contains a character that cannot be | |
| 17 represented in the current code page." | |
| 18 | |
| 19 ### Setting up the environment for Visual Studio | |
| 20 | |
| 21 You must build with Visual Studio 2015 Update 3; no other version is | |
| 22 supported. | |
| 23 | |
| 24 You must have Windows 7 x64 or later. x86 OSs are unsupported. | |
| 25 | |
| 26 ## Getting the compiler toolchain | |
| 27 | |
| 28 Follow the appropriate path below: | |
| 29 | |
| 30 ### Open source contributors | |
| 31 | |
| 32 As of March 11, 2016 Chromium requires Visual Studio 2015 to build. | |
| 33 | |
| 34 Install Visual Studio 2015 Update 3 or later - Community Edition | |
| 35 should work if its license is appropriate for you. Use the Custom Install option | |
| 36 and select: | |
| 37 | |
| 38 - Visual C++, which will select three sub-categories including MFC | |
| 39 - Universal Windows Apps Development Tools > Tools | |
| 40 - Universal Windows Apps Development Tools > Windows 10 SDK (10.0.10586) | |
| 41 | |
| 42 You must have the 10586 SDK installed or else you will hit compile errors such | |
| 43 as redefined macros. | |
| 44 | |
| 45 Install Windows Driver Kit (WDK) 10, or use some other method to get the | |
| 46 Debugging Tools for Windows. | |
| 47 | |
| 48 Run `set DEPOT_TOOLS_WIN_TOOLCHAIN=0`, or set that variable in your | |
| 49 global environment. | |
| 50 | |
| 51 Compilation is done through ninja, **not** Visual Studio. | |
| 52 | |
| 53 ### Google employees | |
| 54 | |
| 55 Run: `download_from_google_storage --config` and follow the | |
| 56 authentication instructions. **Note that you must authenticate with your | |
| 57 @google.com credentials**, not @chromium.org. Enter "0" if asked for a | |
| 58 project-id. | |
| 59 | |
| 60 Run: `gclient sync` again to download and install the toolchain automatically. | |
| 61 | |
| 62 The toolchain will be in `depot_tools\win_toolchain\vs_files\<hash>`, and windbg | |
| 63 can be found in `depot_tools\win_toolchain\vs_files\<hash>\win_sdk\Debuggers`. | |
| 64 | |
| 65 If you want the IDE for debugging and editing, you will need to install | |
| 66 it separately, but this is optional and not needed to build Chromium. | |
| 67 | |
| 68 ## Using the Visual Studio IDE | |
| 69 | |
| 70 If you want to use the Visual Studio IDE, use the `--ide` command line | |
| 71 argument to `gn gen` when you generate your output directory (as described on | |
| 72 the [get the code](http://dev.chromium.org/developers/how-tos/get-the-code) | |
| 73 page): | |
| 74 | |
| 75 ```gn gen --ide=vs out\Default | |
| 76 devenv out\Default\all.sln | |
| 77 ``` | |
| 78 | |
| 79 GN will produce a file `all.sln` in your build directory. It will internally | |
| 80 use Ninja to compile while still allowing most IDE functions to work (there is | |
| 81 no native Visual Studio compilation mode). If you manually run "gen" again you | |
| 82 will need to resupply this argument, but normally GN will keep the build and | |
| 83 IDE files up to date automatically when you build. | |
| 84 | |
| 85 The generated solution will contain several thousand projects and will be very | |
| 86 slow to load. Use the `--filters` argument to restrict generating project files | |
| 87 for only the code you're interested in, although this will also limit what | |
| 88 files appear in the project explorer. A minimal solution that will let you | |
| 89 compile and run Chrome in the IDE but will not show any source files is: | |
| 90 | |
| 91 ```gn gen --ide=vs --filters=//chrome out\Default``` | |
| 92 | |
| 93 There are other options for controlling how the solution is generated, run `gn | |
| 94 help gen` for the current documentation. | |
| 95 | |
| 96 ## Performance tips | |
| 97 | |
| 98 1. Have a lot of fast CPU cores and enough RAM to keep them all busy. | |
| 99 (Minimum recommended is 4-8 fast cores and 16-32 GB of RAM) | |
| 100 2. Reduce file system overhead by excluding build directories from | |
| 101 antivirus and indexing software. | |
| 102 3. Store the build tree on a fast disk (preferably SSD). | |
| 103 4. If you are primarily going to be doing debug development builds, you | |
| 104 should use the component build. Set the [build | |
| 105 arg](https://www.chromium.org/developers/gn-build-configuration) | |
| 106 `is_component_build = true`. | |
| 107 This will generate many DLLs and enable incremental linking, which makes | |
| 108 linking **much** faster in Debug. | |
| 109 | |
| 110 Still, expect build times of 30 minutes to 2 hours when everything has to | |
| 111 be recompiled. | |
| OLD | NEW |