cef源碼 編譯基礎

#cef源碼編譯基礎

本系列博客,參考衆多博客加實踐而成的,可以百度cef mp4.這一篇,僅僅是所有的基礎大雜燴,而後面的幾篇則是正確的如何一步步編譯,相對步驟比較簡單,比如運行什麼,修改什麼.但是如果你不瞭解此篇章的話,可能遇到困難,找到答案也是比較困難的.

這一篇參考的文檔比較多,記錄的比較詳細,是用來解決問題的,但是儘量不要按照此步驟一步步的構建源碼.後期會有各版本編譯步驟.但是你可以從本篇中獲取大量的有用的方案.

bat 腳本常識
註釋 : rem 或者::
echo. 輸出一空行
在.bat腳本文件中,換行符是"^",即shift + 6。
使用兩個%包含一個字符串表示引用環境變量

start 命令1 start 命令2... 同時執行多條 : 
命令1 & 命令2 & 命令3 ... (無論前面命令是否故障,照樣執行後面)   
命令1 && 命令2 && 命令3....(僅當前面命令成功時,才執行後面)   
命令1 || 命令2 || 命令3.... (僅當前面命令失敗時.才執行後面)
call 調用另外一bat

基礎常識

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/chromiumembedded/cef/wiki/AutomatedBuildSetup.md#markdown-header-windows-configuration

也就是

https://bitbucket.org/chromiumembedded/cef/wiki/AutomatedBuildSetup.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:

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:

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:

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 = []`

如果出現:

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/chromiumembedded/cef/wiki/MasterBuildQuickStart.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

~/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).

請使用cmd.exe,而不是 Cygwin shell或git base
路徑不要太長,不超過35個字符,儘量是英文字母,簡潔爲好.

  1. 創建目錄
    c:\code\automate
    c:\code\chromium_git

  2. 下載 https://storage.googleapis.com/chrome-infra/depot_tools.zip,並解壓到 c:\code\depot_tools

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

  4. 增加環境變量 path : c:\code\depot_tools

  5. 下載 automate-git.py script to "c:\code\automate\automate-git.py
    https://bitbucket.org/chromiumembedded/cef/raw/master/tools/automate/automate-git.py

  6. 創建"c:\code\chromium_git\update.bat" 內容如下:
    set GN_DEFINES=use_jumbo_build=true
    set GN_ARGUMENTS=–ide=vs2017 --sln=cef --filters=//cef/*
    python …\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

  1. 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

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

### 分支
官網地址: 

https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding

在這裏插入圖片描述

編譯就請看 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

在這裏插入圖片描述

這裏需要看清,你需要編譯的版本信息.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.

遺留的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+

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/chromiumembedded/cef/issues/1617#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

打包命令 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
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],
    }
  }
}

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'

一些命令

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

錯誤記錄

切換分支需要先保存在源代碼,再切換就不會有問題了
cd %cur_bat_file_path%\chromium\src
git add.
git stash

  1. 報錯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

  1. 報錯2

在這裏插入圖片描述

# cd %cur_bat_file_path%\chromium\src\buildtools
# git stash
# cd %cur_bat_file_path%

再運行之前的程序就可以了.

  1. 報錯3

在這裏插入圖片描述

git add.
git stash

在這裏插入圖片描述

  1. 報錯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/chromiumembedded/cef/wiki/AutomatedBuildSetup.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’, # 此行爲修改過的

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章