CEF挖坑之下載編譯

CEF 官網編譯地址

https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart.md#markdown-header-windows-setup

 

Windows下載編譯

Windows編譯了cef3729和cef3202兩個版本,分別下載源碼。從cef3729 check out到cef3202,出現各種編譯失敗。

1.安裝VS

a. Cef 3202 需要VS2015 update 3

 

必須要安裝win SDK 10.0.14393

 

b. Cef 3729 需要VS2017

免下載包中有windowsSDK10.0.15063,一起安裝了。

VS2017必現安裝到系統盤,禁止安裝到其他盤,否則會在update.bat腳本執行時,報錯找不到。

Traceback (most recent call last):
File "D:\SourceCode\Google\chromium\chromium_git\chromium\src\build\vs_toolchain.py", line 175, in DetectVisualStudioPath
' not found.') % (version_as_year))
Exception: Visual Studio Version 2017 (from GYP_MSVS_VERSION) not found.

或者要設置”%Promgram file(x86)%”的路徑,方法沒嘗試過。

 

2.翻牆代理設置

國內本機下載CEF源碼需要翻牆,設置本地代理。本人使用自搭翻牆服務器Shadowsocks

A. cmd設置git代理 都設置成http://127.0.0.1:port

git config --global http.proxy http://127.0.0.1:port(自己的代理端口,1080)

git config --global https.proxy http://127.0.0.1:port(自己的代理端口,1080)

查看代理設置

git config --global -l

git config --global --unset http.proxy

git config --global --unset https.proxy

 

B.cmd設置本地代理

set http_proxy=http://127.0.0.1:port(自己的代理端口,1080)

set https_proxy=http://127.0.0.1:port(自己的代理端口,1080)

 

3.按照官網教程,下載depot_tools

cmd運行update_depot_tools.bat

cd D:\SourceCode\Google\depot_tools

update_depot_tools.bat

不設置2.B的本地代理,會成功下載.cipd_client.exe,但是會報下面的錯誤

成功之後會在depot_tools目錄下生成這幾個文件及文件夾

添加depot_tools目錄到系統環境變量PATH

 

4.下載automate-git.py 

D:\SourceCode\Google\chromium\automate(自己目錄)

 

5.創建到update.bat

D:\SourceCode\Google\chromium\chromium_git(自己目錄)

A.cef 3202

Cef 3202版本編譯需要set CEF_USE_GN = 1

 

 

B.cef 3729

添加分支分支並編譯版本--branch=3729

添加強制清理check信息 --force-clean 這個參數用於清理ChromiumCef的一些檢出信息,如果沒有一次性下載成功而再次執行下載命令時,需要帶上這個參數來清理一些信息,否則檢出會失敗(第一次下載時直接帶上這個參數也可以)。 

CMD下執行update.bat

cd D:\SourceCode\Google\chromium\chromium_git

update.bat

 

6.創建create.bat

D:\SourceCode\Google\chromium\chromium_git\chromium\src\cef

添加內容如下

1.Cef 3202

 

2.Cef 3729

AACH264支持的屬性在下面文件中查看

set GN_DEFINES=use_jumbo_build=true proprietary_codecs=true ffmpeg_branding=Chrome

D:\SourceCode\Google\chromium\chromium_git\chromium\src\third_party\ffmpeg\chromium\scripts\build_ffmpeg.py

 

A.在此CMD次目錄下執行create.bat

cd D:\SourceCode\Google\chromium\chromium_git\chromium\src\cef

create.bat

 

B.會生成VSdebug release x86 x64到 路徑

D:\SourceCode\Google\chromium\chromium_git\chromium\src\out

 

C.查看Debug_X64工程參數在

D:\SourceCode\Google\chromium\chromium_git\chromium\src\out\Debug_GN_x64\args.gn

 

7.編譯

CMD目錄下D:\SourceCode\Google\chromium\chromium_git\chromium\src,執行

cd D:\SourceCode\Google\chromium\chromium_git\chromium\src

ninja -C out\Debug_GN_x86 cef

 

8.CMD執行cefclient

cd D:\SourceCode\Google\chromium\chromium_git\chromium\src

out\Debug_GN_x86\cefclient.exe

輸入html5test.com 測試

 

Mac系統下載編譯

需要注意一下幾點,先執行1 和2,其他按照官網流程即可。

1.設置代理

A.cmd設置git代理 都設置成http://127.0.0.1:port

git config --global http.proxy http://127.0.0.1:port(自己的代理端口,1087)

git config --global https.proxy http://127.0.0.1:port(自己的代理端口,1087)

查看代理設置 git config --global -l

 

B.cmd設置本地代理

export http_proxy=http://127.0.0.1:port(自己的代理端口,1087)

export https_proxy=http://127.0.0.1:port(自己的代理端口,1087)

不要設置成https://127.0.0.1:1087否則會報錯

2.需要重新編譯curl

支持https,否則會代理下載失敗

3.編輯create.sh

export GN_DEFINES='use_jumbo_build=true  proprietary_codecs=true ffmpeg_branding=Chrome'

 加單引號,Windows必須不能加,Mac必須加

 

轉載地址:https://blog.csdn.net/gokartscomeon/article/details/97629644

 

 

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