|
This page describes how to build the Chromium code on Linux. Read this if you're interested in testing the build or porting code.
Before Starting- Prerequisites: what you need to build
- Get the Code: checkout the source code
- Do not get the code before you have installed the prerequisites, otherwise the gclient sync command may generate incorrect build files.
- Be sure to follow the Get the Code instruction closely.
- Important: ensure that you have GYP_GENERATORS=make in your environment before running gclient sync or gclient runhooks --force. This tells the Chromium build system to output Makefiles. Example:
export GYP_GENERATORS=make
gclient sync All make commands should be run from $CHROMIUM_ROOT/src directory. Build output will be in the $CHROMIUM_ROOT/src/out directory. Configuring- If you are building with gcc 4.4 (or newer) compilation flags will be tweaked automatically to work around some strict aliasing and other issues. Since the buildbots use an older compiler version, compilation with gcc 4.4.x does break from time to time however. File a bug or ask on IRC if you are having trouble with gcc 4.4.x please. If you're getting warnings, can't build because of that, but just want to get things done, you can specify GYP_DEFINES='werror=' to disable -Werror that is on by default.
- On a 64-bit system, set GYP_DEFINES=target_arch=x64 and regenerate the Makefiles by doing gclient runhooks --force.
- To do a parallel build, add -jX where X is the number of make processes to start up. This is useful for multiple-core machines or machines using distcc. See LinuxFasterBuilds for more info. Example:
cd $CHROMIUM_ROOT/src
make -j5 chrome # Good for a 4 core machine CompilationBuild in debug mode: $ cd $CHROMIUM_ROOT/src
$ make The above builds all libraries and tests in all components. Specifying other target names to restrict the build to just what you're interested in. Example: to build just chrome: $ cd $CHROMIUM_ROOT/src
$ make chrome or to build just the simplest unit test: $ cd $CHROMIUM_ROOT/src
$ make base_unittests Or you can specify the explicit file you want to build: $ cd $CHROMIUM_ROOT/src
$ make out/Debug/chrome ExecutablesExecutables are written in $CHROMIUM_ROOT/src/out/Debug for Debug builds, and $CHROMIUM_ROOT/src/out/Release for Release builds Release modeAdd BUILDTYPE=Release to the make invocation: $ cd $CHROMIUM_ROOT/src
$ make BUILDTYPE=Release Seeing the actual commandsIf you want to see the actual commands that make is invoking, add V=1 to the make invocation. $ cd $CHROMIUM_ROOT/src
$ make V=1 This is useful if, for example, you are debugging gyp changes, or otherwise need to see what make is actually doing. Troubleshooting- If you see make: *** No targets specified and no makefile found. Stop., you probably forgot to either set your GYP_GENERATORS, or run gclient runhooks. See the "Before Starting" steps above.
Advanced FeaturesNext StepsIf you want to contribute to the effort toward a Chromium-based browser for Linux, please check out the Linux Development page for more information.
|