欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

WIN10编译Chromiumbb记录

程序员文章站 2022-07-01 12:02:08
...

一、 编译环境准备
Chromiumbb:git clone https://github.com/bloomberg/chromium.bb.git
Python2.7: https://www.python.org/downloads/release/python-2715/
VS2015: https://my.visualstudio.com/Downloads?PId=2226
depot_tools: https://storage.googleapis.com/chrome-infra/depot_tools.zip
电脑:
WIN10编译Chromiumbb记录
(这些代码和工具不用*下载比较慢,可以考虑国内网站找找)

参考Chromiumbb readme:

Branch Structure

The master branch contains the code that is used to make the
official Chromium builds used by Bloomberg. It is not used for
development. Actual development happens in one of the bugfix/* or
feature/* branches.

Each bugfix/* or feature/* branch is based on the
upstream/latest branch, which contains a snapshot of the code we get
from the upstream Chromium project.

The release/candidate branch contains changes that are scheduled to
be included in the next release.

Cloning the repository

By default, Git for Windows has a very small limit on the maximum
filename length. Some files in this repository exceed this 260
character limit so it’s important to configure Git to allow long
filenames.

        git config --global core.longpaths true
        git clone https://github.com/bloomberg/chromium.bb.git
        git checkout master

If you don’t want to set this configuration at the global level, you
can do the following instead:

        git init
        git config core.longpaths true
        git remote add origin https://github.com/bloomberg/chromium.bb.git
        git fetch origin master
        git checkout master

Build Instructions

Bloomberg Employees: Build steps

If you are not a Bloomberg employee, the following instructions
should still work:

  • Download the dependencies:

  • Setup your build environment:

          export PATH="${DEPOT_TOOLS_PATH}:${PATH}"
          export DEPOT_TOOLS_WIN_TOOLCHAIN=0
    

    Please replace ${DEPOT_TOOLS_PATH} with the path to your
    depot_tools.

  • Run the following command from inside the top-level directory:

          cd src
          build/runhooks.py
          build/blpwtk2.py
    

    This will generate the necessary ninja makefiles needed for the
    build.

  • Run the following commands to start the build:

          ninja -C out/shared/Debug blpwtk2_all    # for component Debug builds
          ninja -C out/shared/Release blpwtk2_all  # for component Release builds
          ninja -C out/static/Debug blpwtk2_all    # for non-component Debug builds
          ninja -C out/static/Release blpwtk2_all  # for non-component Release builds
    

Microsoft, Windows, Visual Studio and ClearType are registered trademarks of Microsoft Corp.
Firefox is a registered trademark of Mozilla Corp.
Chrome is a registered trademark of Google Inc.

二、 安装
1、vs2015安装
关键是要选择Win10 SDK
WIN10编译Chromiumbb记录
WIN10编译Chromiumbb记录

2,,python2.7
一路默认就行,安装好后添加环境变量

3,depot_tools
下载后解压,再添加路径到环境变量,然后添加新环境变量DEPOT_TOOLS_WIN_TOOLCHAIN为0

最后环境变量如下:
WIN10编译Chromiumbb记录
WIN10编译Chromiumbb记录

三、 编译
1、打开命令行,进入chromiumbb文件所目录,执行
python src\build\runhooks.py
2、进入src,执行
ninja -C out\static\Debug blpwtk2_all
3、正常情况应该可以编译出可执行文件了,在\out\static\Debug\content_shell.exe路径,可以输入下面进行测试:
.\out\static\Debug\content_shell.exe https://www.baidu.com/
能看到如下画面:
WIN10编译Chromiumbb记录

4、编译相关问题
我这边第一次编译因为WIN10 SDK没安装的原因,很快就报错了,第二次提示如下:

c:\program files (x86)\windows kits\10\include\10.0.18362.0\um\versionhelpers.h(162): error C2220: 警告被视为错误 - 没有生成“object”文件
c:\program files (x86)\windows kits\10\include\10.0.18362.0\um\versionhelpers.h(162): warning C4800: “BOOL”: 将值强制为布尔值“true”或“false”(性能警告)

应该是把警告当成错误了,我这边暂时想了个办法,versionhelpers.h文件的162行,直接返回true,暂时没看到什么问题

return TRUE;
//return fActiveSessionCountLimited;//原始返回