Building Chromium on Windows from source

Google’s open-source Chromium browser has been gaining a lot of interest from me, as I’ve been trying to build it for ARM64 since January. This past month, I’ve FINALLY accomplished making an ARM64 native build – which is very exciting due to the slowness of x86 translation. If you’re reading this I’m sure you want to know how to build it yourself. Luckily Google has provided some awesome documentation for compiling, but I’m going to skip past the parts that may confuse others. Let’s get to it!

Prerequisites

The most important part of this build process is making sure the prerequisites are met. I’ve gone through this numerous times, only to fail at the end and have to start over (which is NOT fun).

Here’s the minimum requirements I recommend:

  • Quad-core Core i7, Xeon, or AMD Ryzen Desktop equivalent processor from at least 2015.
    Even though you CAN build with a mobile processor, I wouldn’t. This thing needs some serious power to run through the crazy amount of clang threads that get invoked to compile the files.
  • 16 GB RAM.
    This is a very intensive build process, don’t do this to yourself by only rolling with 8GB of RAM or less.
  • 100 GB of free space.
    You can get away with having 50GB free, but you’re not going to have much of anything left over.
  • M.2 or SSD.
    You DO NOT want to try this with a platter drive, because you will completely suffer.
  • Visual Studio 2017/2019.
    You will need VS 2017/2019 with the latest Windows 10 SDK installed, along with the C++ Individual Components for the architecture you’re targeting the build for. I stuck with the libraries using v142 of the MSVC build tools and also the C++ MFC & ATL build tools. If you’re going to build for ARM64, then you will need the components for x86 & x64, along with ARM64 for things to work properly.


My home desktop at this moment is using a core i7 860, 16GB RAM, SSD, Windows 10, VS 2019. It took 5 hours to build for me and that’s simply because I’m using an old i7.

My work laptop is running a core i7-8850H, 32GB RAM, M.2, Windows 10, VS 2019… It still took me 4-5 hours to build!



Pulling Down the Source

The first thing to do is to open Command Prompt as Administrator, create a directory off of the root drive that has at least 100 GB space free and name it something simple like “chrome”. Next make a “build” and  “tools” folders inside of the “chrome” directory.

cd d:\ && mkdir chrome\build && mkdir chrome\tools && cd d:\chrome\build

Next thing that needs to happen is to extract the depot_tools zip to the tools folder.

Before we can kick off the process to pull down the source, we have to set some needed environment variables. The path to the tools folder will need to be set as the first path in the environment variable so that the version of python that it pulls down will be used first, otherwise you risk failing half way through the process and needing to start over. Then, an environment variable will be added to tell the depot tools to use your local Visual Studio install, instead of a google version. Last but not least, a variable is set that defines the version of Visual Studio to that you want to use the C++ build files from. Make sure you choose the right VS version for the components you’ve installed.

set Path=d:\chrome\tools;%PATH% && setx Path “d:\chrome\tools;%PATH%”

set DEPOT_TOOLS_WIN_TOOLCHAIN=0 && setx DEPOT_TOOLS_WIN_TOOLCHAIN “0”

set GYP_MSVS_VERSION=2019 && setx GYP_MSVS_VERSION “2019”


To install the Windows tools needed to kick everything off, run the following command:

gclient


Next - assuming you’re in the “build” directory within the command prompt, it’s time to run the command to pull down the latest source, which will create a “src” directory when complete (Usually takes about 30 mins):

fetch chromium --no-history && cd src

Generating the Build Files

Here comes the fun part, creating the build from a list of arguments. What I’ve done is use a command that allows for you to paste arguments into a notepad window and then proceed to generate the build files when the file is saved:

gn args out/Release

By now you should see a notepad window. Here are the arguments I’ve used for my ARM64 builds. Feel free to paste in and make sure you replace the weird quotation marks manually, otherwise you might run into problems:


enable_nacl = false
use_jumbo_build = true
is_component_build = true
is_debug = false
strip_absolute_paths_from_debug_symbols = true
symbol_level = 0
target_cpu = “arm64”
properitary_codecs = true
ffmpeg_branding = “Chrome”
blink_symbol_level = 0

These arguments will make building the source faster than normal, but at the expense of debugging (If any of you care about doing debugging)


Now for the actual BUILD. There’s many build actions you can run with autoninja, but the common action is “chrome”. This will generate the executables in the out/Release folder. If you want to create an installer, it’s best to build with “mini_installer”. This will create a setup installer with the applicable files compressed in a chrome.7z file.

autoninja –C out\Release chrome


At this point, the build is running and all files available in the out\Release folder when complete. If you’re not cool enough to have amazing computer specs, you’ll have to suffer like me and wait 5 hours for a build, but those who are lucky can build in 30 minutes.


Good luck!