Overview
Due mostly to its history and its complexity, Chromium uses a nonstandard set of custom tools to check out and build. Here's an overview of the steps you'll run:
-
gclient. A checkout involves pulling nearly 100 different SVN repositories of code. This process is managed with a tool calledgclient.
-
gyp. The cross-platform build configuration system is calledgyp, and
on Linux it generates Makefiles. Runninggypis analogous to the./configurestep
seen in most other software.
-
make. The actual build itself uses GNUmake.
- We don't provide any sort of "install" step.
Getting a checkout
Linux users often prefer to use Git. We have apage on how to check out the main tree with Git, but note that you still
will need to understand and run all ofgclientandgypanyway.
First Time Build Bootstrap
Configuring
Aftergclient syncfinishes, it will rungypautomatically
to generate the Makefiles. You can re-run gyp yourself asbuild/gyp_chromium.
gypsupports a minimal amount of build configuration via the-Dflag.
./build/gyp_chromium -Dflag1=value1 -Dflag2=value2
-
gcc warnings. By default we fail to build if there are any compiler warnings. If you're getting warnings, can't build because of that, but just want to get things done, you can specify-Dwerror=to
turn that off.
-
ChromeOS.-Dchromeos=1builds the ChromeOS version of Chrome. This
isnotall of ChromeOS (seethe ChromiumOSpage for full build instructions), this is just the slightly tweaked version of the browser that runs on
that system. Its not designed to be run outside of ChromeOS and some features won't work, but compiling on your Linux desktop can be useful for certain types of development and testing.
Compilation
The weird "src/" directory is an artifact of gclient. Start with:
$ cd src
Build just chrome
$ make chrome
Faster builds
To do a parallel build, add-jXwhere X is the number of make processes
to start up. This is useful for multiple-core machines or machines using distcc.
Build every tests
$ make
The above builds all libraries and tests in all components.It will take hours.
Specifying other target names to restrict the build to just what you're interested in. To build just the simplest unit test:
$ make base_unittests
Or you can specify the explicit file you want to build:
$ make out/Debug/chrome
GCC 4.6 is not supported yet.You may run into some build errors (and patches are welcome to fix them). Please seehttp://crbug.com/80071before
you proceed.
Clang builds
Information about building with Clang can be foundhere.
Output
Executables are written insrc/out/Debug/for Debug builds, andsrc/out/Release/for
Release builds.
Release mode
AddBUILDTYPE=Releaseto the make invocation:
$ make BUILDTYPE=Release
Seeing the commands
If you want to see the actual commands that make is invoking, addV=1to
the make invocation.
$ make V=1
This is useful if, for example, you are debugging gyp changes, or otherwise need to see what make is actually doing.
Clean builds
All built files are put into theout/directory, so to start over with
a clean build, just:
rm -rf out
Troubleshooting
If you seemake: *** No targets specified and no makefile found. Stop.,
you probably need to rungypagain. See the "Configuring" steps above.
Linker Crashes
If, during the final link stage:
LINK(target) out/Debug/chrome
You get an error like:
collect2: ld terminated with signal 6 Aborted terminate called after throwing an instance of 'std::bad_alloc'
collect2: ld terminated with signal 11 [Segmentation fault], core dumped
you are probably running out of memory when linking. Try one of:
- Use thegoldlinker
- Build on a 64-bit computer
- Build in Release mode (debugging symbols require a lot of memory)
- Build as shared libraries (note: this build is for developers only, and may have broken functionality)
Most of these are described on the
LinuxFasterBuildspage.
Advanced Features
Next Steps
If you want to contribute to the effort toward a Chromium-based browser for Linux, please check out theLinux Development
pagefor more information.
相关推荐
断断续续下载chromium代码花了1周左右,代码约15G左右,其中遇到power shell的问题,遇到python的问题。最终编译花了11:30分。相比于Linux下的编译慢很多,系统运行的稳定性和速度也差很多。打算研究源码,一起分享...
安卓版Chromium的源码,适用于需要定制浏览器开发的场景,代码比较庞大,完整的Chromium浏览器内核。
详细的描述了chromium从开始下载到编译成功的各个步骤,方便后来人少走弯路。
VS2017编译Chromium Embedded Framework(CEF) 一、 下载 二、 用CMake配置工程 三、 编译工程 四、 修改例子测试
经过几天的摸索,终于通过本地的chromiumos kernel源码生成了zImage用于arm移植,修改kernel源码,并编译,可以进行内核移植咯。。。希望对大家有帮助
该文件属于Chromium 58版本的编译配置文档,其中,包含每一项参数的说明。 请注意,该文档是通过gn args --list out/debug生成的,如果你已下载Chromium源码,可以手动生成,不必下载。
Chromium Chromium是一个开放源代码的浏览器项目,旨在为所有用户构建更安全,更快,更稳定的方式来体验Web。 该项目的网站是https://www.chromium.org。 Chromium中的文档Chromium是一个开放源代码的浏览器项目,...
libcef源码(分支3202)源码+编译中遇到的问题及解决方法
chromium编译工具gn源码
cef chromium-75.0.3770.100-win64(支持h264)编译好的Release包。 资源全称:cef_binary_cef_binary_75.1.16+g16a67c4+chromium-75.0.3770.100_windows64_windows64 对应cef版本:75.1.16 对应chromium版本:75.0....
Chromium是一个开放源代码的浏览器项目,旨在为所有Internet用户构建一种更安全,更快,更稳定的方式来体验Web。该站点包含设计文档,体系结构概述,测试信息等,以帮助您学习构建和使用Chromium源代码。
C#写的Chromium核心的简单多标签浏览器源码,编译成功后把dll文件夹里面的文件复制到运行目录即可,浏览器核心版本号Chromium 43.0.2357.130
最近对Chromium源码进行了下载与编译,由于花费时间较长而且一些错误感觉并不是很好解决,特地写了一篇文档来记录整个从下载到编译完成的过程,以及我遇到的一些问题的解决方案。
chromium源码编译需要的资源 直接解压到跟源码对应的路径下面 并添加路径到环境变量中
2008年9月,谷歌推出了Chrome的浏览器以及其源代码库- 铬项目,chrome浏览器背后的开源项目chromium project也成为了历史上最成功的开源项目之一,开源软件爱好者们可以在自己的电脑上下载源码,编译一个完整的...
采用wget方式下载资源的download_from_google_storage.py, 可以轻松在墙内下载并编译chromium源码
在ubuntu 14.04下编译并运行chrommiuos,折腾了两天,终于下完源码,编译成功,并在KVM上运行起来了.
根据官方源码,加上支持视频的参数,编译,亲测可用,编译日期2022.06 支持H.264, AAC, MP4, MP3等文件 里面有官方示例程序,可以运行访问 html5test.com 验证 文件为压缩包,包含两个文件,内容如下 示例:cef_...
本源码2019-09-03下载的,环境搭建过程已经通过自己测试,按下面环境搭建可以直接进行项目编译。 由于每个人使用场景可能不一样,这里就不直接提供编译后的库文件了 v8 2019-09-03.zip目录说明: v8 2019-09-03.zip...
Chromium Embedded Framework (CEF)源码,亲测可编译出libcef.dll,版本是1916