chromium
https://blog.catrol.cn/articles/[Chromium]compile-chromium.html
function proxy_off(){
unset http_proxy
unset https_proxy
unset ftp_proxy
unset rsync_proxy
}
function proxy_on() {
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
export http_proxy="http://127.0.0.1:1087"
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
export FTP_PROXY=$http_proxy
export RSYNC_PROXY=$http_proxy
}
初次下载(支持断点续传):
fetch --no-history chromium
编译后,拉取全部history
git fetch --unshallow
git fetch --shallow-since=15/11/2012
git fetch --depth=100
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set depot_tools=c:\dev\chromium\depot_tools
set PATH=%depot_tools%;C:\chromium-dev;%PATH%;
gn gen --ide=vs --filters=//chrome --no-deps out\Default --args="is_component_build=true is_debug=true"
autoninja -C out\Default chrome
gn gen --ide=vs --filters=//chrome --no-deps out\Default --args="is_component_build=true is_debug=true enable_nacl=false target_cpu=\"x86\" v8_symbol_level=0 cc_wrapper =\"sccache\" chrome_pgo_phase = 0"
target_os="win"
target_cpu="x64"
is_component_build=false
is_debug=false
is_official_build=true
Build options
https://www.chromium.org/developers/gn-build-configuration/
is_debug = false
Component build
The component build links many parts of Chrome into separate shared libraries to avoid the long link step at the end. It is the default when compiling debug non-iOS builds and most developers use this mode for everyday builds and debugging. Startup is slower and some linker optimizations won't work, so don't do benchmarks in this mode. Some people like to turn it on for release builds to get both faster links and reasonable runtime performance.
is_component_build = true
Faster builds with no or minimal symbols
The symbol_level setting varies from 0 (no symbols or minimal symbols) to 2 (full symbols).
symbol_level = 0
Disable Native Client
Most developers don't normally need to test Native Client capabilities and can speed up the build by disabling it.
enable_nacl = false
Remove WebCore symbols
WebCore has lots of templates that account for a large portion of the debugging symbols. If you're not debugging WebCore, you can set the blink symbol level to 0 or 1:
blink_symbol_level=0
Remove v8 symbols
v8 is often the second-largest source of debugging symbols. If you're not debugging v8, you can set the v8 symbol level to 0 or 1:
v8_symbol_level=0
Windows
There is a gn gen argument (--ide) for producing Visual Studio project and solution files:
$ gn gen out\mybuild --ide=vs