转载请说明原出处,谢谢~~:
1.下载源码编译,先下载depot_tools并解压,把路径添加到环境变量path中。
2.下载automate-git.py脚本。
安装时要选择windows桌面开发,C++ MFC等。
Support for newer branches begins when they enter the Chromium beta channel. Support for older branches ends when they exit the Chromium stable channel. The Spotify automated builder provides CEF builds for the current Chromium stable channel and will switch to the next Chromium branch when that branch is promoted to the stable channel. Updating CEF branches is currently a manual process so there will likely be a delay between Chromium release announcements and the availability of associated CEF builds. See the Chromium release calendar for estimated Chromium release dates and versions.
Branch Date | Release Branch | Chromium Version | Windows Build Requirements | macOS Build Requirements | Linux Build Requirements |
---|---|---|---|---|---|
Mar 2018 | 3359 | 66 | Win 7+, VS2017 15.3.2+, Win10.0.15063.468 SDK, Ninja | macOS 10.9-10.12, 10.9+ build system, 10.9+ deployment target, 10.10 base SDK, Xcode 8.3, Ninja, 64-bit only | Ubuntu 14.04+, Debian Jessie+, Ninja |
Jan 2018 | 3325 | 65 | Win 7+, VS2017 15.3.2+, Win10.0.15063.468 SDK, Ninja | macOS 10.9-10.12, 10.9+ build system, 10.9+ deployment target, 10.10 base SDK, Xcode 8.3, Ninja, 64-bit only | Ubuntu 14.04+, Debian Jessie+, Ninja |
set CEF_USE_GN=1
set GN_DEFINES=is_official_build=true ffmpeg_branding=Chrome proprietary_codecs=true
set GN_ARGUMENTS=--ide=vs2017 --sln=cef --filters=//cef/*
set GYP_DEFINES=buildtype=Official
set GYP_MSVS_VERSION=2017
set CEF_ARCHIVE_FORMAT=tar.bz2
python ..\automate\automate-git.py --download-dir=E:\buildLib\cef\source --depot-tools-dir=E:\buildLib\cef\depot_tools --branch=3359 --no-build --no-distrib --force-update
python ..\automate\automate-git.py --no-depot-tools-update --download-dir=E:\buildLib\cef\source --depot-tools-dir=E:\buildLib\cef\depot_tools --no-distrib --no-build --branch=3325 --checkout=6d8faa49425e1eba7c3a1527b5b2185e67cbb2cc --force-update
如何确定--checkout值
4).点击相应commit,即可在地址栏中得到checkout值。例:6d8faa49425e1eba7c3a1527b5b2185e67cbb2cc
https://bitbucket.org/chromiumembedded/cef/commits/6d8faa49425e1eba7c3a1527b5b2185e67cbb2cc?at=3325
5.修复gs://文件的下载:
所有云储存的文件全部通过https下载,先参照RunWget.bat脚本
工具无法下载
RunWget.bat gs://chromium-gn/c0d03f78af494365ff38c663297a20fe61da29ea src/buildtools/win/gn.exe
RunWget.bat gs://chromium-clang-format/c8455d43d052eb79f65d046c6b02c169857b963b src/buildtools/win/clang-format.exe
RunWget.bat gs ://chromium-apache-win32/11ba0c1941b9c46ad279f33c2db3e3c628197ae8 src/third_party/apache-win32\bin\httpd.exe
RunWget.bat gs ://chromium-apache-win32/199cb003a5a40db260f29128ae630f298aaf7702 src/third_party/apache-win32\bin\libapriconv-1.dll
RunWget.bat gs ://chromium-apache-win32/d76ccf8a113227d63927616a45d7c8eb8df44cc7 src/third_party/apache-win32\bin\libapr-1.dll
RunWget.bat gs ://chromium-apache-win32/4e51ce1a90b99d7b08a0ed1d151eee023d43966c src/third_party/apache-win32\bin\libaprutil-1.dll
RunWget.bat gs ://chromium-apache-win32/230b1d13ba0c4c90089e5e239b2f206ce313bb1e src/third_party/apache-win32\bin\libhttpd.dll
RunWget.bat gs ://chromium-apache-win32/4dca3606f57e1ea9bde5d1e088bda0ae0d4ad3e0 src/third_party/apache-win32\bin\libeay32.dll
RunWget.bat gs ://chromium-apache-win32/2c7b52a7f6b9651a9ba19119d3d842247d541af6 src/third_party/apache-win32\bin\ApacheMonitor.exe
RunWget.bat gs ://chromium-apache-win32/02c3d37fac86cd239fe02a1842134775e40a3331 src/third_party/apache-win32\bin\ssleay32.dll
RunWget.bat gs ://chromium-apache-win32/923f8e771902c6da79ae720817cba8b389a6b275 src/third_party/apache-win32\bin\php5ts.dll
RunWget.bat gs ://chromium-apache-win32/c54ee354a2cdc075b9b4379cf58aba90ebea774b src/third_party/apache-win32\bin\zlib1.dll
RunWget.bat gs ://chromium-apache-win32/27b23f5fc9f2ace1ae53edbee3f32ef0a5d37287 src/third_party/apache-win32\bin\openssl.exe
RunWget.bat gs ://chromium-apache-win32/eb6e8b068a8db9dfa80180ea16b0927b33760298 src/third_party/apache-win32\modules\mod_asis.so
RunWget.bat gs ://chromium-apache-win32/49345ed7627a7019402c46db98bca55a6da80ace src/third_party/apache-win32\modules\mod_alias.so
RunWget.bat gs ://chromium-apache-win32/99b9959e5fbec830fd08a8d398c52f23894dd485 src/third_party/apache-win32\modules\mod_autoindex.so
RunWget.bat gs ://chromium-apache-win32/333d1d54b459797d9419fce049e7d5efe7fb0a69 src/third_party/apache-win32\modules\mod_cgi.so
RunWget.bat gs ://chromium-apache-win32/b2a72bb8447cda2800be56db3959bb8bac68e810 src/third_party/apache-win32\modules\mod_authz_host.so
RunWget.bat gs ://chromium-apache-win32/f6eebd3da324d7a4c36593677ccefcb626ac9548 src/third_party/apache-win32\modules\mod_log_config.so
RunWget.bat gs ://chromium-apache-win32/5926b9d7d4f1e3aae31c10e0498923cb2fbc19a9 src/third_party/apache-win32\modules\mod_headers.so
RunWget.bat gs ://chromium-apache-win32/b7dd1e015a88c96e03bb8845636472bb256e862b src/third_party/apache-win32\modules\mod_mime.so
RunWget.bat gs ://chromium-apache-win32/8c81e5e9fa1d6d07d5235e553b42ac02be49b996 src/third_party/apache-win32\modules\mod_ssl.so
RunWget.bat gs ://chromium-apache-win32/81c42674bc5865c3df35a9f47e3bc6910d89c4b1 src/third_party/apache-win32\modules\php5apache2_2.dll
RunWget.bat gs ://chromium-apache-win32/ee17b7f92645403edb0c3bb80ceeb49791989995 src/third_party/apache-win32\modules\mod_rewrite.so
RunWget.bat gs ://chromium-apache-win32/3158bdd7fabd47b3ff5188d3dd9cee42c97b334a src/third_party/apache-win32\modules\mod_env.so
6.添加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
将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,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'
7.编译
我的编译bat
set CEF_USE_GN=1
set GN_DEFINES=is_official_build=true ffmpeg_branding=Chrome proprietary_codecs=true
set GYP_DEFINES=buildtype=Official
set GYP_MSVS_VERSION=2017
set CEF_ARCHIVE_FORMAT=tar.bz2
set GYP_GENERATORS=ninja,msvs-ninja
set GN_ARGUMENTS=--ide=vs2017 --sln=cef --filters=//cef/*
set WIN_CUSTOM_TOOLCHAIN=1
set CEF_VCVARS=none
set GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
set SDK_ROOT=C:\Program Files (x86)\Windows Kits\10
set INCLUDE=C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include;%INCLUDE%
set PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX64\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.13.26020\x64\Microsoft.VC141.CRT;%PATH%
set LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\ucrt\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\lib\x86;%LIB%
set VS_CRT_ROOT=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\crt\src\vcruntime
python ..\automate\automate-git.py --download-dir=e:\buildLib\cef\source --depot-tools-dir=e:\buildLib\cef\depot_tools --branch=3359 --no-update --no-debug-build --build-log-file --verbose-build --force-distrib --force-build
编译中的问题:
a.编码问题:提示文件非unicode存储 warning 4819
解决: 控制面板->区域和语言->非Unicode程序的语言 修改成 英语(美国)
b.编译chromium缺少LASTCHANGE问题
错误: error: '../../build/util/LASTCHANGE.blink', needed by 'gen/webkit_version.h', missing and no known rule to make itc.SDK错误
编译cef3325时FAILED: obj/third_party/anglebANGLE/Caps.obj
c:\program files (x86)\windows kits\10\include\10.0.15063.0\um\wrl\event.h(228,112): error: use of undeclared identifier 'DefaultDelegateCheckMode'
template
SDK的错误,将228行更改为
template
x64bat
set CEF_USE_GN=1
set GN_DEFINES=is_official_build=true ffmpeg_branding=Chrome proprietary_codecs=true
set GYP_DEFINES=buildtype=Official
set GYP_MSVS_VERSION=2017
set CEF_ARCHIVE_FORMAT=tar.bz2
set GYP_GENERATORS=ninja,msvs-ninja
set GN_ARGUMENTS=--ide=vs2017 --sln=cef --filters=//cef/*
set WIN_CUSTOM_TOOLCHAIN=1
set CEF_VCVARS=none
set GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
set SDK_ROOT=C:\Program Files (x86)\Windows Kits\10
set PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.13.26020\x64\Microsoft.VC141.CRT;%PATH%
set LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\ucrt\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\lib\x64;%LIB%
set INCLUDE=C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include;%INCLUDE%
set VS_CRT_ROOT=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\crt\src\vcruntime
python ..\automate\automate-git.py --x64-build --download-dir=e:\buildLib\cef\source --depot-tools-dir=e:\buildLib\cef\depot_tools --branch=3359 --no-update --no-debug-build --build-log-file --verbose-build --force-distrib --force-build
备注:bat中的选项可以有:
--download-dir 源码下载目录
--depot-tools-dir 工具包目录
--branch 源码分支(默认trunk主分支)
--checkout 指定patch版本(默认最近提交)
--no-build 下载完不自动开始编译(我们需要修改编译配置)
--no-update 确定源码下载完毕仅重新编译时使用
--force-build 强制编译(发现在有成功编译的时候再编译不会执行,可以加上这个
--no-debug-build 只编译release版本
--no-release-build 只编译debug版本
最终Dll输出路径为:
chromium\src\out\Release
chromium\src\cef\binary_distrib
需要直接使用二进制的点这里下载https://download.csdn.net/download/diycom/10391250
支持Flash
复制chrome.exe浏览器插件C:\Users\Administrator\AppData\Local\Google\Chrome\User Data
cefclient --ppapi-flash-path=".\PepperFlash\29.0.0.140\pepflashplayer.dll" --ppapi-flash-version=29.0.0.140
参考:
https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
https://bitbucket.org/chromiumembedded/cef/wiki/AutomatedBuildSetup.md
在Windows下编译Cef3.2623并加入mp3、mp4支持(附带源码包和最终DLL)
http://blog.csdn.net/zhuhongshu/article/details/54193842
https://blog.csdn.net/baidu_32237719/article/details/79509819
https://blog.csdn.net/tiplip/article/details/42047815