Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2831|回复: 0
打印 上一主题 下一主题

cef源码 编译基础

[复制链接]

1272

主题

2067

帖子

7962

积分

认证用户组

Rank: 5Rank: 5

积分
7962
跳转到指定楼层
楼主
发表于 2023-2-11 15:57:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#cef源码编译基础

本系列博客,参考众多博客加实践而成的,可以百度cef mp4.这一篇,仅仅是所有的基础大杂烩,而后面的几篇则是正确的如何一步步编译,相对步骤比较简单,比如运行什么,修改什么.但是如果你不了解此篇章的话,可能遇到困难,找到答案也是比较困难的.

这一篇参考的文档比较多,记录的比较详细,是用来解决问题的,但是尽量不要按照此步骤一步步的构建源码.后期会有各版本编译步骤.但是你可以从本篇中获取大量的有用的方案.

bat 脚本常识
注释 : rem 或者::
echo. 输出一空行
在.bat脚本文件中,换行符是"^",即shift + 6。
使用两个%包含一个字符串表示引用环境变量

start 命令1 start 命令2... 同时执行多条 :
命令1 & 命令2 & 命令3 ... (无论前面命令是否故障,照样执行后面)   
命令1 && 命令2 && 命令3....(仅当前面命令成功时,才执行后面)   
命令1 || 命令2 || 命令3.... (仅当前面命令失败时.才执行后面)
call 调用另外一bat
1
2
3
4
5
6
7
8
9
10
11
基础常识
cef 是Chromium Embeded Framework 谷歌开源浏览器扩展而来,便在其他程序中得到浏览器的功能.

cef2623 是支持xp系统的,而官方因版权等问题并没有加入mp4的功能,需要咱们人为的进行编译,当然现市面上,编译出的版本已经足够多了,源码网上也能够找的到,希望大家好运.

我历经一月的时间,经过换宽带,再进行梯子下载,记得要早上进行下载,我最高时能够达到15M网速,晚上及下午多才1M多的网速.时不时断一下,又得重新下载,如果没有好的网速和稳定的梯子工具,机器要配置高一些,起码编译下来得6个多小时不能少.重装系统,装vs这些你得考虑下,各版本对吧.

且不说这些安装系统和vs,下载源码和编译时间就得很长,还有编译过程一旦报错,你如果能够解决,这一趟编译就得3个小时,报错找方案是不是又得浪费大把的时间.

如果您需要各版本的库和源码,并支持MP4的功能,请联系我qq:908462363.

推荐的一些博文
https://github.com/fanfeilong/cefutil
https://blog.csdn.net/zhuhongshu/article/details/70159672
http://www.cnblogs.com/hezhixiong/p/5935143.html
https://blog.csdn.net/xiezhongyuan07/article/details/84861617

配置说明
默认安装

保证安装的vs要默认安装到系统盘,否则的话很复杂,需要设置各SDk版本在哪里等等的问题. 保证CEF源码 存在的位置要大于150G,最好在固态硬盘上.

总之一句话,默认就行,c盘,vs和SDK只有一个版本,360软件等杀毒软件,请卸载.保证系统清洁,这是个重装的活.

win10:1809,安装vs和对应的win10 SDK版本

避免潜在的交叉编译,请保持,本机系统只有一个win10 SDK,不要多装SDK,避免麻烦,如果编译多个CEF,SDK不同,vs不同,请重新安装系统和编译器,保证正确性和准确性.一般是vs2013Update5,vs2015Update3.

python2.7版本(运行脚本),但已集成在depot_tools,设置环境变量就成.

源码下载完成后,切不要立即修改源码.

Patch打完之后,建议禁止Patch脚本,再进行修改.此时应该备份一份源码.

设置区域语言

可能会有编码错误,建议设置:控制面板–>区域–>管理–>非Unicode语言–>更改系统区域设置–>英语美国

设置环境变量

注意: 不要把环境变量设置在右键计算机–>属性–>环境变量处.(有的机器可能需要重启才能够生效).

建议CMD 管理员运行,cd d:\xxx d:

重启系统

如果vs安装在非默认路径,请尝试
我放到这里说明吧,vs不是安装在指定目录,sdk不在指定目录等情况的话:请按照下面的资料进行尝试,但不建议这样做,折腾过后或许你会成功吧.

官网内容简介:
https://bitbucket.org/chromiumem ... ndows-configuration

也就是

https://bitbucket.org/chromiumem ... omatedBuildSetup.md

关于官方wiki,可以下载下来看看.

git clone https://bitbucket.org/chromiumembedded/cef.git/wiki

官网大致内容:

32位机器上:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86;

Windows Configuration
What's Required
Windows 7 or newer, 64-bit OS.
Visual Studio 2017 15.3.2+.
Windows 10.0.15063.468 SDK.
At least 8GB of RAM and 40GB of free disk space.

See comments in gclient_hook.py for Windows custom toolchain requirements. VS + SDK can be packaged for distribution to build agents using a script like Chromium's package_from_installed.py.

WARNING: If you are using VS2017 15.5.* to build 3282 branch then you must add enable_precompiled_headers=false to GN_DEFINES to avoid a known issue with clang.

set vs_root=C:\Program Files (x86)\Microsoft Visual Studio 14.0
set sdk_root=C:\Program Files (x86)\Windows Kits\10
set sdk_version=10.0.16299.0
set vs_crt_root=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt
set vc_tools_version=14.16.27023

32-bit Build Commands
To build 32-bit CEF on a 64-bit Windows host system:

#set GN_DEFINES=is_official_build=true
#set GYP_MSVS_VERSION=2017
#set CEF_ARCHIVE_FORMAT=tar.bz2
#automate-git.py --download-dir=%download_dir% --branch=%cef_branch% --minimal-distrib --client-distrib --force-clean

If VS2017 or SDK is not installed to the default location then set the following before executing automate-git.py:

#set WIN_CUSTOM_TOOLCHAIN=1
#set CEF_VCVARS=none
#set GYP_MSVS_OVERRIDE_PATH=%vs_root%
#set VS_CRT_ROOT=%vs_crt_root%
#set SDK_ROOT=%sdk_root%
#set PATH=%sdk_root%\bin\%sdk_version%\x86;%vs_root%\VC\Tools\MSVC\%vc_tools_version%\bin\HostX64\x86;%vs_root%\VC\Tools\MSVC\%vc_tools_version%\bin\HostX64\x64;%vs_root%\VC\Redist\MSVC\%vc_redist_version%\x64\%vc_redist_crt%;%vs_root%\SystemCRT;%PATH%
set LIB=%sdk_root%\Lib\%sdk_version\um\x86;%sdk_root%\Lib\%sdk_version\ucrt\x86;%vs_root%\VC\Tools\MSVC\%vc_tools_version%\lib\x86;%vs_root%\VC\Tools\MSVC\%vc_tools_version%\atlmfc\lib\x86;%LIB%
#set INCLUDE=%sdk_root%\Include\%sdk_version%\um;%sdk_root%\Include\%sdk_version%\ucrt;%sdk_root%\Include\%sdk_version%\shared;%vs_root%\VC\Tools\MSVC\%vc_tools_version%\include;%vs_root%\VC\Tools\MSVC\%vc_tools_version%\atlmfc\include;%INCLUDE%

64-bit Build Commands
To build 64-bit CEF on a 64-bit Windows host system:

#set GN_DEFINES=is_official_build=true
#set GYP_MSVS_VERSION=2017
#set CEF_ARCHIVE_FORMAT=tar.bz2
#automate-git.py --download-dir=%download_dir% --branch=%cef_branch% --minimal-distrib --client-distrib --force-clean --x64-build

If VS2017 or SDK is not installed to the default location then set the following before executing automate-git.py:

#set WIN_CUSTOM_TOOLCHAIN=1
#set CEF_VCVARS=none
#set GYP_MSVS_OVERRIDE_PATH=%vs_root%
#set VS_CRT_ROOT=%vs_crt_root%
#set SDK_ROOT=%sdk_root%
#
set PATH=%sdk_root%\bin\%sdk_version%\x64;%vs_root%\VC\Tools\MSVC\%vc_tools_version%\bin\HostX64\x64;%vs_root%\VC\Redist\MSVC\%vc_redist_version%\x64\%vc_redist_crt%;%vs_root%\SystemCRT;%PATH%
set LIB=%sdk_root%\Lib\%sdk_version\um\x64;%sdk_root%\Lib\%sdk_version\ucrt\x64;%vs_root%\VC\Tools\MSVC\%vc_tools_version%\lib\x64;%vs_root%\VC\Tools\MSVC\%vc_tools_version%\atlmfc\lib\x64;%LIB%
#set INCLUDE=%sdk_root%\Include\%sdk_version%\um;%sdk_root%\Include\%sdk_version%\ucrt;%sdk_root%\Include\%sdk_version%\shared;%vs_root%\VC\Tools\MSVC\%vc_tools_version%\include;%vs_root%\VC\Tools\MSVC\%vc_tools_version%\atlmfc\include;%INCLUDE%


vs2015

If VS2015 or SDK is not installed to the default location then set the following before executing automate-git.py:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
set WIN_CUSTOM_TOOLCHAIN=1
set CEF_VCVARS=none
set GYP_MSVS_OVERRIDE_PATH=%vs_root%
set VS_CRT_ROOT=%vs_crt_root%
set SDK_ROOT=%sdk_root%
set PATH=%sdk_root%\bin\x86;%vs_root%\VC\bin;%PATH%
set LIB=%sdk_root%\Lib\10.0.10586.0\um\x86;%sdk_root%\Lib\10.0.10586.0\ucrt\x86;%vs_root%\VC\lib;%vs_root%\VC\atlmfc\lib;%LIB%
set INCLUDE=%sdk_root%\Include\10.0.10586.0\um;%sdk_root%\Include\10.0.10586.0\ucrt;%sdk_root%\Include\10.0.10586.0\shared;%sdk_root%\Include\10.0.10586.0\winrt;%vs_root%\VC\include;%vs_root%\VC\atlmfc\include;%INCLUDE%


**64-bit Build Commands**

To build 64-bit CEF on a 64-bit Windows host system:

1
2
3
4
5
set CEF_USE_GN=1
set GN_DEFINES=is_official_build=true
set GYP_DEFINES=buildtype=Official
set GYP_MSVS_VERSION=2015
set CEF_ARCHIVE_FORMAT=tar.bz2
automate-git.py --download-dir=%download_dir% --branch=%cef_branch% --minimal-distrib --client-distrib --force-clean --x64-build


If VS2015 or SDK is not installed to the default location then set the following before executing automate-git.py:

1
2
3
set WIN_CUSTOM_TOOLCHAIN=1
set CEF_VCVARS=none
set GYP_MSVS_OVERRIDE_PATH=%vs_root%
set VS_CRT_ROOT=%vs_crt_root%
set SDK_ROOT=%sdk_root%
set PATH=%sdk_root%\bin\x64;%vs_root%\VC\bin\amd64;%PATH%
set LIB=%sdk_root%\Lib\10.0.10586.0\um\x64;%sdk_root%\Lib\10.0.10586.0\ucrt\x64;%vs_root%\VC\lib\amd64;%vs_root%\VC\atlmfc\lib\amd64;%LIB%
set INCLUDE=%sdk_root%\Include\10.0.10586.0\um;%sdk_root%\Include\10.0.10586.0\ucrt;%sdk_root%\Include\10.0.10586.0\shared;%sdk_root%\Include\10.0.10586.0\winrt;%vs_root%\VC\include;%vs_root%\VC\atlmfc\include;%INCLUDE%


说的也很详细了,参考 cef/tools/gclient_hook.py,大致30行 DEPOT_TOOLS_WIN_TOOLCHAIN.

总之及时备份rar解/压缩,第一次在下载所有源码后,进行备份.

打完Patch 完成后,再修改源码,备份.

因为官方更新速度很快的,请不要编译官方的最新版本,可能release没有问题,debug会编译出错. 正因为更新速度很快,所以咱们需要 离线编译,指定

`--depot-tools-dir, --no-depot-tools-update --no-update`

Patch打成功后,就禁用Patch,修改chromium\src\cef\patch\patch.cfg.末尾处添加一行.
`patches = []`

如果出现:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Patching build configuration and source files for CEF…
________ running ‘depot_tools\win_tools-2_7_6_bin\python\bin\python.exe tools/patcher.py --patch-config patch/patch.cfg’ in ‘d:\cef3\source\chromium\src\cef’
–> successfully patched …
–> successfully patched …

Generating CEF project files…


走到此处说明patch已打好,成功之后就说明源码已经没有问题了,可以进行源码备份了,此后出现错误属于编译错误,需要解决错误即可.修改后,删除out文件夹,再次编译即可.

## 官网md介绍
https://bitbucket.org/chromiumembedded/cef/src?at=master

## 正式构建源码

建议先了解,再看下面的分支 一章,选择适合的命令和方式进行编译,仅供参考,编译过程中,千辛万难.

https://bitbucket.org/chromiumem ... rBuildQuickStart.md

The below steps can often be used to develop the most recent release branch of CEF/Chromium in addition to the master branch. Chromium build requirements change over time so review the build requirements listed on the BranchesAndBuilding Wiki page before attempting to build a release branch. Then just add --branch=XXXX to the automate-git.py command-line where "XXXX" is the branch number you wish to build.

大致意思是,除了构建主分支之外,还可以构建分支--branch=xxx ,但从结果来看,一般构建的是分支的最后一个版本,较为稳定的,最新的可能有很多版,但这个分支只会更新到较为稳定的版本.

构建目录如下: ~ 这里为c:\,当然可以选择d:\,主目录就是code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
~/code/
automate/
automate-git.py <-- CEF build script
chromium_git/
cef/ <-- CEF source checkout
chromium/
src/ <-- Chromium source checkout
update.[bat|sh] <-- Bootstrap script for automate-git.py
depot_tools/ <-- Chromium build tools


What's Required
Windows 7 or newer, 64-bit OS.
Visual Studio VS2017 15.7.1+ installed in the default location.
Windows 10.0.17763 SDK installed in the default location. You must install this exact SDK version to avoid build issues.
At least 8GB of RAM and 40GB of free disk space.
Approximately 2 hours with a fast internet connection (25Mbps) and fast build machine (2.6Ghz+, 4+ logical cores).

1
2
3
4
5
6
7
8
请使用cmd.exe,而不是 Cygwin shell或git base
路径不要太长,不超过35个字符,尽量是英文字母,简洁为好.

创建目录
c:\code\automate
c:\code\chromium_git

下载 https://storage.googleapis.com/chrome-infra/depot_tools.zip,并解压到 c:\code\depot_tools

更新工具如git,python.
cd c:\code\depot_tools
update_depot_tools.bat

增加环境变量 path : c:\code\depot_tools

下载 automate-git.py script to "c:\code\automate\automate-git.py
https://bitbucket.org/chromiumem ... ate/automate-git.py

创建"c:\code\chromium_git\update.bat" 内容如下:
set GN_DEFINES=use_jumbo_build=true
set GN_ARGUMENTS=–ide=vs2017 --sln=cef --filters=//cef/*
python.bat …\automate\automate-git.py --download-dir=c:\code\chromium_git --depot-tools-dir=c:\code\depot_tools --no-distrib --no-build

运行update.bat,自动下载 “c:\code\chromium_git\cef” 和 "c:\code\chromium_git\chromium\src

cd c:\code\chromium_git
update.bat

7.创建 “c:\code\chromium_git\chromium\src\cef\create.bat”
set GN_DEFINES=use_jumbo_build=true
set GN_ARGUMENTS=–ide=vs2017 --sln=cef --filters=//cef/*
call cef_create_projects.bat

Run the “create.bat” script to generate Ninja and Visual Studio project files.
cd c:\code\chromium_git\chromium\src\cef
create.bat

Create a Debug build of CEF/Chromium using Ninja. Replace “x86” with “x64” in the below example to generate a 64-bit build instead of a 32-bit build. Edit the CEF source code at “c:\code\chromium_git\chromium\src\cef” and repeat this step multiple times to perform incremental builds while developing.
cd c:\code\chromium_git\chromium\src
ninja -C out\Debug_GN_x86 cef

Run the resulting cefclient sample application.
cd c:\code\chromium_git\chromium\src
out\Debug_GN_x86\cefclient.exe

### 分支
官网地址:

https://bitbucket.org/chromiumem ... BranchesAndBuilding
1
2
3
4
5


编译就请看 MasterBuildQuickStart.md,我主要是在windows上编译,其他系统类似,但应该没有widnows复杂.

这是最新master编译的条件,Win 7+, VS2017 15.7.1+, Win 10.0.17763 SDK, Ninja

这是cef 官网已经编译出来的版本,可以搜索下载.

http://opensource.spotify.com/cefbuilds/index.html

https://www.chromium.org/developers/calendar
1
2
3
4
5
6
7
8
9


这里需要看清,你需要编译的版本信息.cef版本一般都是cef3了,vs版本和win10版本

Legacy Release Branches (Unsupported)

Legacy CEF builds are available from the Spotify automated builder back to 2704 branch. Building legacy branches is not supported. If you choose to build a legacy branch you will need to solve any build errors on your own.

Newer legacy branches (within the past year) can often be built using the same tooling as current branches. You will need to (a) manually download depot_tools, (b) sync depot_tools to a revision that existed at the time of the branch, and (c) set the DEPOT_TOOLS_UPDATE=0 environment variable to keep it from updating automatically.

Older legacy branches can potentially be built by downloading a CEF source archive at the desired branch from here and a Chromium source archive at the associated/required version from here, and then combining them to create the required directory structure.

See the Build Notes section at the end of this page for historical build details.

1
2
3
4
5
6
7
8
9
10
11
12
遗留的CEF构建可以从Spotify自动构建器返回到2704分支。不支持构建遗留分支。如果选择构建遗留分支,则需要自己解决任何构建错误。
较新的遗留分支(在过去一年之内)通常可以使用与当前分支相同的工具构建。您将需要(a)手动下载depot_tools, (b)将depot_tools同步到分支时存在的修订,©设置DEPOT_TOOLS_UPDATE=0环境变量以防止自动更新。
旧的遗留分支可以通过从这里下载所需分支的CEF源存档文件和从这里下载关联/所需版本的Chromium源存档文件来构建,然后将它们组合起来创建所需的目录结构。
也就是说较新的构建,大于2704版本,可能一次性编译就能够通过,不需要进行修改什么错误.需要设置为.
DEPOT_TOOLS_UPDATE=0

master:
Win 7+, VS2017 15.7.1+, Win 10.0.17763 SDK, Ninja       
macOS 10.10-10.14, 10.10+ deployment target, 10.13.2+ build system w/ 10.13+ base SDK (Xcode 9.3.1+), Ninja, 64-bit only       
Ubuntu 14.04+, Debian Jessie+, Ninja

Branch Date        Release Branch        Chromium Version        CEF Version        Windows Build Requirements        macOS Build Requirements        Linux Build Requirements

Mar 2019        3729        74        74, 3        Win 7+, VS2017 15.7.1+, Win 10.0.17763 SDK, Ninja        macOS 10.10-10.14, 10.10+ deployment target, 10.13.2+ build system w/ 10.13+ base SDK (Xcode 9.3.1+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja

Feb 2019        3683        73        73, 3        Win 7+, VS2017 15.7.1+, Win 10.0.17134.0 or 10.0.17763 SDK, Ninja        macOS 10.10-10.14, 10.10+ deployment target, 10.12+ build system w/ 10.12+ base SDK (Xcode 8.3.2+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja

Dec 2018        3626        72        3        Win 7+, VS2017 15.7.1+, Win 10.0.17134.0 or 10.0.17763 SDK, Ninja        macOS 10.10-10.14, 10.10+ deployment target, 10.12+ build system w/ 10.12+ base SDK (Xcode 8.3.2+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Oct 2018        3578        71        3        Win 7+, VS2017 15.7.1+, Win10.0.17134.0 SDK, Ninja        macOS 10.10-10.14, 10.10+ deployment target, 10.12+ build system w/ 10.12+ base SDK (Xcode 8.3.2+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Sep 2018        3538        70        3        Win 7+, VS2017 15.7.1+, Win10.0.17134.0 SDK, Ninja        macOS 10.10-10.13, 10.10+ deployment target, 10.12+ build system w/ 10.12+ base SDK (Xcode 8.3.2+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Jul 2018        3497        69        3        Win 7+, VS2017 15.7.1+, Win10.0.17134.0 SDK, Ninja        macOS 10.10-10.13, 10.10+ deployment target, 10.12+ build system w/ 10.12+ base SDK (Xcode 8.3.2+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Jun 2018        3440        68        3        Win 7+, VS2017 15.7.1+, Win10.0.17134.0 SDK, Ninja        macOS 10.10-10.13, 10.10+ deployment target, 10.12+ build system w/ 10.12+ base SDK (Xcode 8.3.2+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Apr 2018        3396        67        3        Win 7+, VS2017 15.3.2+, Win10.0.15063.468 SDK, Ninja        macOS 10.10-10.13, 10.10+ deployment target, 10.12+ build system w/ 10.12+ base SDK (Xcode 8.3.2+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Mar 2018        3359        66        3        Win 7+, VS2017 15.3.2+, Win10.0.15063.468 SDK, Ninja        macOS 10.10-10.13, 10.10+ deployment target, 10.12+ build system w/ 10.12+ base SDK (Xcode 8.3.2+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Jan 2018        3325        65        3        Win 7+, VS2017 15.3.2+, Win10.0.15063.468 SDK, Ninja        macOS 10.10-10.13, 10.10+ deployment target, 10.12+ build system w/ 10.12+ base SDK (Xcode 8.3.2+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Dec 2017        3282        64        3        Win 7+, VS2017 15.3.2+, Win10.0.15063.468 SDK, Ninja        macOS 10.10-10.13, 10.10+ deployment target, 10.12+ build system w/ 10.12+ base SDK (Xcode 8.3.2+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Oct 2017        3239        63        3        Win 7+, VS2017 15.3.2+, Win10.0.15063.468 SDK, Ninja        macOS 10.10-10.13, 10.10+ deployment target, 10.12+ build system w/ 10.12+ base SDK (Xcode 8.3.2+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Sep 2017        3202        62        3        Win 7+, VS2015u3, Win10.0.14393 SDK, Ninja        macOS 10.10-10.12, 10.10+ deployment target, 10.12+ build system w/ 10.12+ base SDK (Xcode 8.3.2+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Jul 2017        3163        61        3        Win 7+, VS2015u3, Win10.0.14393 SDK, Ninja        macOS 10.9-10.12, 10.9+ deployment target, 10.9+ build system w/ 10.10+ base SDK (Xcode 8.3+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Jun 2017        3112        60        3        Win 7+, VS2015u3, Win10.0.14393 SDK, Ninja        macOS 10.9-10.12, 10.9+ deployment target, 10.9+ build system w/ 10.10+ base SDK (Xcode 8.3+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Apr 2017        3071        59        3        Win 7+, VS2015u3, Win10.0.14393 SDK, Ninja        macOS 10.9-10.12, 10.9+ deployment target, 10.9+ build system w/ 10.10+ base SDK (Xcode 8.3+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Jessie+, Ninja
Mar 2017        3029        58        3        Win 7+, VS2015u3, Win10.0.14393 SDK, Ninja        macOS 10.9-10.12, 10.9+ deployment target, 10.9+ build system w/ 10.10+ base SDK (Xcode 8.3+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Wheezy+, Ninja
Jan 2017        2987        57        3        Win 7+, VS2015u3, Win10.0.14393 SDK, Ninja        macOS 10.9-10.12, 10.9+ deployment target, 10.9+ build system w/ 10.10+ base SDK (Xcode 7.3.1+), 64-bit only        Ubuntu 14.04+, Debian Wheezy+, Ninja
Nov 2016        2924        56        3        Win 7+, VS2015u3, Win10.0.10586 SDK, Ninja        macOS 10.9-10.12, 10.9+ deployment target, 10.9+ build system w/ 10.10+ base SDK (Xcode 7.3.1+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Wheezy+, Ninja
Oct 2016        2883        55        3        Win 7+, VS2015u3, Win10.0.10586 SDK, Ninja        macOS 10.9-10.12, 10.7+ deployment target, 10.9+ build system w/ 10.10+ base SDK (Xcode 7.3.1+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Wheezy+, Ninja
Aug 2016        2840        54        3        Win 7+, VS2015u2 or VS2015u3, Win10.0.10586 SDK, Ninja        macOS 10.9-10.12, 10.7+ deployment target, 10.9+ build system w/ 10.10+ base SDK (Xcode 7.3.1+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Wheezy+, Ninja
Jul 2016        2785        53        3        Win 7+, VS2015u2 or VS2015u3, Win10.0.10586 SDK, Ninja        macOS 10.9-10.11, 10.7+ deployment target, 10.9+ build system w/ 10.10+ base SDK (Xcode 7.3.1+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Wheezy+, Ninja
May 2016        2743        52        3        Win 7+, VS2015u2 or VS2015u3, Win10.0.10586 SDK, Ninja        macOS 10.9-10.11, 10.7+ deployment target, 10.9+ build system w/ 10.10+ base SDK (Xcode 7.1.1+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Wheezy+, Ninja
Apr 2016        2704        51        3        Win 7+, VS2015u2, Win10.0.10586 SDK, Ninja        macOS 10.9-10.11, 10.7+ deployment target, 10.9+ build system w/ 10.10+ base SDK (Xcode 7.1.1+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Wheezy+, Ninja
Jan 2016        2623        49        3        WinXP+, VS2013u4 or VS2015u1 (experimental), Win10 SDK, Ninja        macOS 10.6-10.11, 10.6+ deployment target, 10.7+ build system w/ 10.10+ base SDK (Xcode 7.1.1+), Ninja, 64-bit only        Ubuntu 14.04+, Debian Wheezy+, Ninja
Oct 2015        2526        47        3        WinXP+, VS2013u4 or VS2015u1 (experimental), Win8.1 SDK, Ninja        macOS 10.6-10.11, 10.6+ deployment target, 10.10 base SDK, Xcode 6.1, Ninja, 64-bit only        Ubuntu 12.04+, Debian Wheezy+, Ninja
Jul 2015        2454        45        3        WinXP+, VS2013u4, Win8.1 SDK, Ninja        macOS 10.6-10.10, 10.6+ deployment target, 10.9 base SDK, Xcode 6.1, Ninja, 64-bit only        Ubuntu 12.04+, Debian Wheezy+, Ninja
Apr 2015        2357        43        3        WinXP+, VS2013u4, Win8.1 SDK, Ninja        macOS 10.6-10.10, 10.6+ deployment target, 10.9 base SDK, Xcode 6.1, Ninja, 64-bit only        Ubuntu 12.04+, Debian Wheezy+, Ninja
Jan 2015        2272        41        3        WinXP+, VS2013u4, Win8.1 SDK, Ninja        macOS 10.6-10.10, 10.6+ deployment target, 10.9 base SDK, Xcode 6.1, Ninja, 64-bit only        Ubuntu 12.04+, Debian Wheezy+, Ninja
Oct 2014        2171        39        3        WinXP+, VS2013u4, Win8.1 SDK, Ninja        macOS 10.6-10.9, 10.6+ SDK, Xcode 5.1.1, Ninja        Ubuntu 12.04+, Debian Wheezy+, Ninja
Aug 2014        2062        37        3        WinXP+, VS2013, Win8 SDK, Ninja        macOS 10.6-10.9, 10.6+ SDK, Xcode 5.1.1, Ninja        Ubuntu 12.04+, Debian Wheezy+, Ninja
Apr 2014        1916        35        3        WinXP+, VS2013, Win8 SDK, Ninja        macOS 10.6-10.9, 10.6+ SDK, Xcode 5.1.1, Ninja        Ubuntu 12.04+, Debian Wheezy+, Ninja
Jan 2014        1750        33        3        WinXP+, VS2010-2013, Win8 SDK, Ninja        macOS 10.6-10.9, 10.6+ SDK, Xcode 5.1.1, Ninja        Ubuntu 12.04+, Debian Wheezy+, Ninja
Oct 2013        1650        31        3        WinXP+, VS2010-2012, Win8 SDK, Ninja (optional)        macOS 10.6-10.9, 10.6+ SDK, Xcode 5.1.1, Ninja        Ubuntu 12.04+, Debian Wheezy+, Ninja
Jul 2013        1547        29        3        WinXP+, VS2010-2012, Win8 SDK, Ninja (optional)        macOS 10.6-10.8, 10.6+ SDK, Xcode 3.2.6-4.x, Ninja (optional)        Ubuntu 12.04+, Debian Squeeze+, Ninja
Apr 2013        1453        27        1, 3        WinXP+, VS2010, Win8 SDK, Ninja (optional)        macOS 10.6-10.8, 10.6+ SDK, Xcode 3.2.6-4.x, Ninja (optional)        Ubuntu 12.04+, Debian Squeeze+, Ninja (optional)
Jan 2013        1364        25        1, 3        WinXP+, VS2010, Win8 SDK, Ninja (optional)        macOS 10.6-10.8, Xcode 3.2.6-4.x, Ninja (optional)        Ubuntu 12.04+, Debian Squeeze+, Ninja (optional)
Oct 2012        1271        23        1, 3        WinXP+, VS2010, Win7 SDK        macOS 10.6-10.8, 10.6+ SDK, Xcode 3.2.6-4.x        Ubuntu 12.04+, Debian Squeeze+
Aug 2012        1180        21        1, 3        WinXP+, VS2010, Win7 SDK        macOS 10.6-10.7, 10.5+ SDK, Xcode 3.2.6-4.x        Ubuntu 12.04+, Debian Squeeze+
Apr 2012        1084        19        1        WinXP+, VS2008, Win7 SDK        macOS 10.6-10.7, 10.5+ SDK, Xcode 3.2.6-4.x        Ubuntu 10.04+, Debian Squeeze+
Feb 2012        1025        18        1        WinXP+, VS2008, Win7 SDK        macOS 10.6-10.7, 10.5+ SDK, Xcode 3.2.6-4.x        Ubuntu 10.04+, Debian Squeeze+
Dec 2011        963        17        1        WinXP+, VS2008, Win7 SDK        macOS 10.6-10.7, 10.5+ SDK, Xcode 3.2.6        Ubuntu 10.04+, Debian Squeeze+

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Note that 1025 and older branches contain only CEF1 source code and that 1547 and newer branches contain only CEF3 source code.

master 分支 build

python /path/to/automate/automate-git.py --download-dir=/path/to/download

To build a release branch:
python /path/to/automate/automate-git.py --download-dir=/path/to/download --branch=2785

默认情况,脚本会下载depot_tools,Chromium,CEF源代码, build Debug and Release,并创建二进制发行包,

其中"/path/to/download/chromium/src/cef/binary_distrib"

相同的下载目录可用于构建多个CEF分支(只需指定一个不同的分支命令行值),现有的“/path/to/download/chromium/src/out”目录将被移动到“/path/to/download/out_(previousbranch)”,以便不会丢失前一个分支的构建输出。当您切换回以前的分支时,out目录将恢复到原来的位置。

The script will create a 32-bit build on Windows by default. To create a 64-bit build on Windows, macOS or Linux specify the --x64-build command-line flag. 32-bit builds on macOS are no longer supported starting with 2272 branch so this flag is now required when building 2272+ on that platform.

Ninja must be used when building newer CEF/Chromium branches.

Clang is used by default for compiling/linking Chromium/CEF on macOS in all branches, Linux starting in 2063 branch, and Windows starting in 3282 branch.

GYP is supported by 2785 branch and older. GN is supported by 2785 branch and newer, and required starting with 2840 branch. Set CEF_USE_GN=1 to build 2785 branch with GN instead of GYP.

大概意思是:从2785版本可以设置 CEF_USE_GN=1 使用GN,之前的版本 CEF_USE_GN=0

Component builds are supported by 3202 branch and newer and significantly reduce link time. Add is_component_build=true to GN_DEFINES in combination with the above VS-version-specific values. Component builds cannot be used to create a CEF binary distribution. See issue #1617 for details.

https://bitbucket.org/chromiumem ... 17#comment-38074395

预先设置的环境变量
:: 默认打包格式为zip,其余为tar.gz/tar.bz2
set CEF_ARCHIVE_FORMAT=tar.bz2

::2785之前使用GYP编译
::set CEF_USE_GN=0
::2785-至今,使用GN
set CEF_USE_GN=1
:: 设置64位 GYP版本-----
::set GYP_DEFINES=target_arch=x64
:: GN 需要 build out/[Debug|Release]_GN_x64
:: official 官方构建集 GYP-----
::set GYP_DEFINES=buildtype=Official
:: GN
set GN_DEFINES=is_official_build=true
:: 如果计算机上安装了多个版本的vs则设置-----
set GYP_MSVS_VERSION=2015
::如果需要vs和ninja进行调试和编译则设置 GYP -----
set GYP_GENERATORS=ninja,msvs-ninja
:: GN
set GN_ARGUMENTS=–ide=vs2017 --sln=cef --filters=//cef/*
:: 为了获得最佳的本地开发人员(非官方调试)构建时性能 vs2015-----
set GN_DEFINES=is_win_fastlink=true
::vs2017
set GN_DEFINES=use_jumbo_build=true
:: 禁止更新 -----

::告诉depot_tools使用您本地安装的Visual Studio版本(缺省情况下,depot_tools将尝试使用Google内部版本)
set DEPOT_TOOLS_WIN_TOOLCHAIN=0 // 不设置0 则出现 Username for ‘https://chrome-internal.googlesource.com’:

automate-git.py --help 查看所有的
–help
–download-dir 源码下载目录 -->重要
–depot-tools-dir 工具包目录(如果没下载的话,可以不用指定,就会下载匹配版本的depot_tools)–>重要
–branch 源码分支(如果不指定,就默认选择编译master分支)–>重要
–no-build 下载完不自动开始编译 -->重要
–no-update 不进行工具升级 -->重要
–force-build 编译 -->重要
–no-debug-build 只编译release版本 -->重要
–no-release-build 只编译debug版本
–no-distrib 不进行打包发布 -->重要
–force-clean 用于清理chromium和cef的一些检出信息,如果下载失败,重新执行下载时,需要带上这个参数来清理一些信息,否则会失败。
–force-clean 强制执行 clean Chromium Git checkout -->不建议使用
–force-clean-deps 下载赶紧的依赖项,存在的“src/out”目录中的任何构建输出都将被删除.如果依赖出了问题,可以用这个命令
–x64-build 64位 : -->重要
–force-distrib 打包 -->重要
–minimal-distrib -->重要
–minimal-distrib-only
–client-distrib : 客户端程序包 -->重要
–client-distrib-only
–sandbox-distrib
–verbose-build 打印出编译连接时的详细信息
–build-log-file 打印日志

–help:

D:\code_xin\chromium_git>python automate-git.py --help
Usage: automate-git.py [options]

This utility implements automation for the download, update, build and
distribution of CEF.

Options:
  -h, --help            show this help message and exit
  --download-dir=DIR    Download directory with no spaces [required].
  --depot-tools-dir=DIR
                        Download directory for depot_tools.
  --depot-tools-archive=DEPOTTOOLSARCHIVE
                        Zip archive file that contains a single top-level
                        depot_tools directory.
  --branch=BRANCH       Branch of CEF to build (trunk, 1916, ...). This will
                        be used to name the CEF download directory and to
                        identify the correct URL if --url is not specified.
                        The default value is trunk.
  --url=URL             CEF download URL. If not specified the default URL
                        will be used.
  --chromium-url=CHROMIUMURL
                        Chromium download URL. If not specified the default
                        URL will be used.
  --checkout=CHECKOUT   Version of CEF to checkout. If not specified the most
                        recent remote version of the branch will be used.
  --chromium-checkout=CHROMIUMCHECKOUT
                        Version of Chromium to checkout (Git branch/hash/tag).
                        This overrides the value specified by CEF in
                        CHROMIUM_BUILD_COMPATIBILITY.txt.
  --chromium-channel=CHROMIUMCHANNEL
                        Chromium channel to check out (canary, dev, beta or
                        stable). This overrides the value specified by CEF in
                        CHROMIUM_BUILD_COMPATIBILITY.txt.
  --chromium-channel-distance=CHROMIUMCHANNELDISTANCE
                        The target number of commits to step in the channel,
                        or 0 to use the newest channel version. Used in
                        combination with --chromium-channel.
  --force-config        Force creation of a new gclient config file.
  --force-clean         Force a clean checkout of Chromium and CEF. This will
                        trigger a new update, build and distribution.
  --force-clean-deps    Force a clean checkout of Chromium dependencies. Used
                        in combination with --force-clean.
  --dry-run             Output commands without executing them.
  --dry-run-platform=DRYRUNPLATFORM
                        Simulate a dry run on the specified platform (windows,
                        macosx, linux). Must be used in combination with the
                        --dry-run flag.
  --force-update        Force a Chromium and CEF update. This will trigger a
                        new build and distribution.
  --no-update           Do not update Chromium or CEF. Pass --force-build or
                        --force-distrib if you desire a new build or
                        distribution.
  --no-cef-update       Do not update CEF. Pass --force-build or --force-
                        distrib if you desire a new build or distribution.
  --force-cef-update    Force a CEF update. This will cause local changes in
                        the CEF checkout to be discarded and patch files to be
                        reapplied.
  --no-chromium-update  Do not update Chromium.
  --no-depot-tools-update
                        Do not update depot_tools.
  --fast-update         Update existing Chromium/CEF checkouts for fast
                        incremental builds by attempting to minimize the
                        number of modified files. The update will fail if
                        there are unstaged CEF changes or if Chromium changes
                        are not included in a patch file.
  --force-patch-update  Force update of patch files.
  --resave              Resave patch files.
  --log-chromium-changes
                        Create a log of the Chromium changes.
  --force-build         Force CEF debug and release builds. This builds
                        [build-target] on all platforms and chrome_sandbox on
                        Linux.
  --no-build            Do not build CEF.
  --build-target=BUILDTARGET
                        Target name(s) to build (defaults to "cefclient").
  --build-tests         Also build the test target specified via --test-
                        target.
  --no-debug-build      Don't perform the CEF debug build.
  --no-release-build    Don't perform the CEF release build.
  --verbose-build       Show all command lines while building.
  --build-failure-limit=BUILDFAILURELIMIT
                        Keep going until N jobs fail.
  --build-log-file      Write build logs to file. The file will be named
                        "build-[branch]-[debug|release].log" in the download
                        directory.
  --x64-build           Create a 64-bit build.
  --arm-build           Create an ARM build.
  --run-tests           Run the ceftests target.
  --no-debug-tests      Don't run debug build tests.
  --no-release-tests    Don't run release build tests.
  --test-target=TESTTARGET
                        Test target name to build (defaults to "ceftests").
  --test-prefix=TESTPREFIX
                        Prefix for running the test executable (e.g. `xvfb-
                        run` on Linux).
  --test-args=TESTARGS  Arguments that will be passed to the test executable.
  --force-distrib       Force creation of a CEF binary distribution.
  --no-distrib          Don't create a CEF binary distribution.
  --minimal-distrib     Create a minimal CEF binary distribution.
  --minimal-distrib-only
                        Create a minimal CEF binary distribution only.
  --client-distrib      Create a client CEF binary distribution.
  --client-distrib-only
                        Create a client CEF binary distribution only.
  --sandbox-distrib     Create a cef_sandbox static library distribution.
  --sandbox-distrib-only
                        Create a cef_sandbox static library distribution only.
  --no-distrib-docs     Don't create CEF documentation.
  --no-distrib-archive  Don't create archives for output directories.
  --clean-artifacts     Clean the artifacts output directory.
  --distrib-subdir=DISTRIBSUBDIR
                        CEF distrib dir name, child of
                        chromium/src/cef/binary_distrib

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
打包命令 make_distrib.py
打包命令: 最终的包名称,网上这部分其实都隐藏了,少之又少,因为官方命令是分开的,而网上的又是执行一条命令编译和打包在一块的.
cef_binary_3.2704.1434.gec3e9ed_windows32.tar.bz2



cd /path/to/chromium/src/cef/tools
make_distrib.bat --ninja-build 打包
--output-dir 输出目录
--allow-partial 允许一部分,而不是所有的debug和release在一起的,我只想打release,就使用这项.
--client 并且打二进制包
--minimal
--x64-build
--no-symbols

make_distrib.bat --help
Usage: make_distrib.py [options]
This utility builds the CEF Binary Distribution.
Options:
  -h, --help            show this help message and exit
  --output-dir=DIR      output directory [required]
  --distrib-subdir=DISTRIBSUBDIR
                        name of the subdirectory for the distribution
  --allow-partial       allow creation of partial distributions
  --no-symbols          don't create symbol files
  --no-docs             don't create documentation
  --no-archive          don't create archives for output directories
  --ninja-build         build was created using ninja
  --x64-build           create a 64-bit binary distribution
  --arm-build           create an ARM binary distribution (Linux only)
  --minimal             include only release build binary files
  --client              include only the sample application
  --sandbox             include only the cef_sandbox static library (macOS and
                        Windows only)
  -q, --quiet           do not output detailed status information

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Usage: gclient.py sync [options]

Checkout/update all modules.


Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -j JOBS, --jobs=JOBS  Specify how many SCM commands can run in parallel;
                        defaults to 8 on this machine
  -v, --verbose         Produces additional output for diagnostics. Can be
                        used up to three times for more logging info.
  --gclientfile=CONFIG_FILENAME
                        Specify an alternate .gclient file
  --spec=SPEC           create a gclient file containing the provided string.
                        Due to Cygwin/Python brokenness, it can't contain any
                        newlines.
  --no-nag-max          Ignored for backwards compatibility.
  -f, --force           force update even for unchanged modules
  -n, --nohooks         don't run hooks after the update is complete
  -p, --noprehooks      don't run pre-DEPS hooks
  -r REV, --revision=REV
                        Enforces revision/hash for the solutions with the
                        format src@rev. The src@ part is optional and can be
                        skipped. You can also specify URLs instead of paths
                        and gclient will find the solution corresponding to
                        the given URL. If a path is also specified, the URL
                        takes precedence. -r can be used multiple times when
                        .gclient has multiple solutions configured, and will
                        work even if the src@ part is skipped.
  --patch-ref=GERRIT_REF
                        Patches the given reference with the format dep
                        @[target-ref:]patch-ref. For |dep|, you can specify
                        URLs as well as paths, with URLs taking preference.
                        |patch-ref| will be applied to |dep|, rebased on top
                        of what |dep| was synced to, and a soft reset will be
                        done. Use --no-rebase-patch-ref and --no-reset-patch-
                        ref to disable this behavior. |target-ref| is the
                        target branch against which a patch was created, it is
                        used to determine which commits from the |patch-ref|
                        actually constitute a patch. If not given, we will
                        iterate over all remote branches and select one that
                        contains the revision |dep| is synced at. WARNING:
                        |target-ref| will be mandatory soon.
  --with_branch_heads   Clone git "branch_heads" refspecs in addition to the
                        default refspecs. This adds about 1/2GB to a full
                        checkout. (git only)
  --with_tags           Clone git tags in addition to the default refspecs.
  -H, --head            DEPRECATED: only made sense with safesync urls.
  -D, --delete_unversioned_trees
                        Deletes from the working copy any dependencies that
                        have been removed since the last sync, as long as
                        there are no local modifications. When used with
                        --force, such dependencies are removed even if they
                        have local modifications. When used with --reset, all
                        untracked directories are removed from the working
                        copy, excluding those which are explicitly ignored in
                        the repository.
  -R, --reset           resets any local changes before updating (git only)
  -M, --merge           merge upstream changes instead of trying to fast-
                        forward or rebase
  -A, --auto_rebase     Automatically rebase repositories against local
                        checkout during update (git only).
  --deps=OS_LIST        override deps for the specified (comma-separated)
                        platform(s); 'all' will process all deps_os references
  --process-all-deps    Check out all deps, even for different OS-es, or with
                        conditions evaluating to false
  --upstream            Make repo state match upstream branch.
  --output-json=OUTPUT_JSON
                        Output a json document to this path containing summary
                        information about the sync.
  --no-history          GIT ONLY - Reduces the size/time of the checkout at
                        the cost of no history. Requires Git 1.9+
  --shallow             GIT ONLY - Do a shallow clone into the cache dir.
                        Requires Git 1.9+
  --no_bootstrap, --no-bootstrap
                        Don't bootstrap from Google Storage.
  --ignore_locks        GIT ONLY - Ignore cache locks.
  --break_repo_locks    GIT ONLY - Forcibly remove repo locks (e.g.
                        index.lock). This should only be used if you know for
                        certain that this invocation of gclient is the only
                        thing operating on the git repos (e.g. on a bot).
  --lock_timeout=LOCK_TIMEOUT
                        GIT ONLY - Deadline (in seconds) to wait for git cache
                        lock to become available. Default is 5000.
  -t, --transitive      DEPRECATED: This is a no-op.
  -m, --manually_grab_svn_rev
                        DEPRECATED: This is a no-op.
  --validate-syntax     Validate the .gclient and DEPS syntax
  --disable-syntax-validation
                        Disable validation of .gclient and DEPS syntax.
  --no-rebase-patch-ref
                        Bypass rebase of the patch ref after checkout.
  --no-reset-patch-ref  Bypass calling reset after patching the ref.

Examples:
  gclient sync
      update files from SCM according to current configuration,
      *for modules which have changed since last update or sync*
  gclient sync --force
      update files from SCM according to current configuration, for
      all modules (useful for recovering files deleted from local copy)
  gclient sync --revision src@31000
      update src directory to r31000

JSON output format:
If the --output-json option is specified, the following document structure will
be emitted to the provided file. 'null' entries may occur for subprojects which
are present in the gclient solution, but were not processed (due to custom_deps,
os_deps, etc.)

{
  "solutions" : {
    "<name>": {  # <name> is the posix-normalized path to the solution.
      "revision": [<git id hex string>|null],
      "scm": ["git"|null],
    }
  }
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
You must install the “Debugging Tools for Windows” feature from the Windows 10 SDK.

增加MP4支持
增加MP4支持

下面的指令,很重要!!!
set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome
set GYP_DEFINES=branding=Chromium buildtype=Official proprietary_codecs=true ffmpeg_branding=Chrome


2704:GYP 应该需要设置这个.
修改h:\ws\source\chromium\src\cef\cef.gypi,variables节下添加如下即可支持mp3。
'proprietary_codecs': 1,
'ffmpeg_branding': 'Chrome',


将source\chromium\src\third_party\ffmpeg\chromium\scripts\build_ffmpeg.py(703)
  configure_flags['Chrome'].extend([
      '--enable-decoder=aac,h264',
      '--enable-demuxer=aac',
      '--enable-parser=aac,h264',
  ])

    configure_flags['Chrome'].extend([
      '--enable-decoder=aac,h264,mp3',
      '--enable-demuxer=aac,mp3,mov',
      '--enable-parser=aac,h264,mpegaudio',
  ])

改为
configure_flags['Chrome'].extend([  
          '--enable-decoder=aac,h264,mp3,mpeg4,amrnb,amrwb,flv',  
          '--enable-demuxer=aac,mp3,mov,avi,amr,flv',  
          '--enable-parser=aac,h264,mpegaudio,mpeg4video,h263',  
      ])

Chrome采用的FFmpeg的配置选项,在原有的配置选项后面添加如下选项:
分别打开chromium\src\third_party\ffmpeg\chromium\config\Chrome\win\ia32\config.h
和chromium\src\third_party\ffmpeg\chromium\config\Chrome\win\x64\config.h,在原有配置宏FFMPEG_CONFIGURATION里增加以下:
--enable-decoder='rv10,rv20,rv30,rv40,cook,h263,h263i,mpeg4,msmpeg4v1,msmpeg4v2,msmpeg4v3,amrnb,amrwb,ac3,flv' --enable-demuxer='rm,mpegvideo,avi,avisynth,h263,aac,amr,ac3,flv,mpegts,mpegtsraw' --enable-parser='mpegvideo,rv30,rv40,h263,mpeg4video,ac3'


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
一些命令
git checkout -b b3440 branch-heads/3440
cd chromium 或chromium\src
gclient sync --with_branch_heads --with_tags -->常用
git checkout -f -B master remotes/origin/master

通过git来获得的有发行版本号Release 标签(tag)
git checkout -b fjs_3239 tags/63.0.3239.150
gclient sync --with_branch_heads --jobs 16

# 首先确保你已切换到 src 目录下.  
# 这部分应该只需要运行一次就可以了,不过多运行几次也没事儿。  
# 第一次运行时可能需要一段时间,因为它获取额外的1/2 GB左右的分支提交。  
gclient sync --with_branch_heads  
git fetch  
# 签出 src 树下的分支.  
git checkout -b branch_$BRANCH branch-heads/$BRANCH  
# 签出所有的DEPS修改的子模块  
gclient sync --jobs 16  
DEPOT_TOOLS_WIN_TOOLCHAIN
git checkout -f master  
gclient sync --jobs 16sdk_root  

git checkout refs/tags/75.0.3749.0
git stash -->暂存
git pull
git fetch origin master:tmp
git pull -v --progress --force "origin"

gclient sync --with_branch_heads --jobs 16 -->常用

git fetch --tags //显示最近发布的标签号
git checkout -b chrome_51.0.2682.1_local_branch 51.0.2682.1
gclient sync --with_branch_heads --disable-syntax-validatio --jobs 16
gclient sync  --nohooks --with_branch_heads  --disable-syntax-validation --jobs 16 -->常用
git rebase --onto 167dc63b4c9a1d0f0fe1b19af93644ac9a561e83 refs/remotes/origin/master

autoninja -C out\Default base

gclient sync  --nohooks --with_branch_heads  --with_tags --jobs 16


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
错误记录
切换分支需要先保存在源代码,再切换就不会有问题了
cd %cur_bat_file_path%\chromium\src
git add.
git stash

报错1

error: Your local changes to the following files would be overwritten by checkout:

Traceback (most recent call last):
File “automate-git.py”, line 1399, in
chromium_src_dir, depot_tools_dir)
File “automate-git.py”, line 61, in run
args, cwd=working_dir, env=env, shell=(sys.platform == ‘win32’))
File “D:\code_xin\chromium_git\depot_tools\win_tools-2_7_6_bin\python\bin\lib\subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘D:\code_xin\chromium_git\depot_tools\git.bat’, ‘checkout’, ‘refs/tags/73.0.3683.75’]’ returned non-zero exit status 1

需要先进行保存

cd %cur_bat_file_path%\chromium\src
git add.
git stash
git checkout -b 73.0.3683.75 refs/tags/73.0.3683.75

报错2


# cd %cur_bat_file_path%\chromium\src\buildtools
# git stash
# cd %cur_bat_file_path%
1
2
3
再运行之前的程序就可以了.

报错3


git add.
git stash



报错4




D:\code_xin\chromium_git\chromium\src\third_party\pdfium

gclient sync --with_branch_heads --with_tags --reset --jobs 16
gclient sync -D

WARNING: ‘src\third_party\dawn’ is no longer part of this client.
It is recommended that you manually remove it or use ‘gclient sync -D’ next time.

自动变异
https://bitbucket.org/chromiumem ... omatedBuildSetup.md
error C2220: 警告被视为错误 - 没有生成“object”文件
已知编译期错误(必设)

忽略警告

视警告为错误 wraning as error, 项目默认设置了高级别警告,会将警告视为错误,并停止编译
修改src\build\common.gypi,有两处, 搜索 ‘WarnAsError’: ‘true’ 改为 ‘WarnAsError’: ‘false’

语法错误: 标识符“EGLSync”
语法错误: 标识符“EGLSync”
src\third_party\swiftshader\include\egl\eglext.h

typedef void *EGLSyncKHR, *EGLSync;
typedef intptr_t EGLAttribKHR, EGLAttrib;

ffmpeg.lib(ffmpeg.wavdec.obj) : error LNK2001: 无法解析的外部符号 ff_w64_guid_data

无法识别的符号 __ff_w64_guid_data

修改 src/third_party/ffmpeg/ffmpeg_generated.gypi , 在585行libavformat/vorbiscomment.c 后面添加 libavformat/w64.c

‘libavformat/vorbiscomment.c’, ‘libavformat/w64.c’, # 此行为修改过的
————————————————
版权声明:本文为CSDN博主「飞剑神」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/wrzfeijianshen/article/details/89928853

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|firemail ( 粤ICP备15085507号-1 )

GMT+8, 2024-11-25 09:59 , Processed in 0.063138 second(s), 19 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表