栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Chromium 实战(一) -- 构建chromium

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Chromium 实战(一) -- 构建chromium

一、准备环境

windows 10 

二、 构建chromium 1. 下载 VS2019

Visual Studio 2019 version 16.11 Release Notes | Microsoft Docs

这里选择的 Community 社区版本,全部都是默认安装位置

2. VS安装完毕后,打开命令行安装需要的插件

在命令行中输入:

"C:Program Files (x86)Microsoft Visual StudioInstallervs_installer.exe" modify --installpath "C:Program Files (x86)Microsoft Visual Studio2019Community" --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --includeRecommended
3. 添加 Debugging Tools For Windows

打开控制面板 → 程序 → 程序和功能 → 选择“Windows Software Development Kit”  → 更改 → change  →  勾选上“Debugging Tools For Windows” → change

等待下载安装完毕

4. 下载 depot tools,并设置环境变量

https://storage.googleapis.com/chrome-infra/depot_tools.zip 下载并解压(我这里放在了 C:src 中)

添加环境变量:

在系统变量中的 path 添加 C:srcdepot_tools

在系统变量中添加 DEPOT_TOOLS_WIN_TOOLCHAIN 变量值设置为0

5. 设置VS临时环境变量,并设置代理

在命令行中输入:

set vs2019_install=C:Program Files (x86)Microsoft Visual Studio2019Community
set http_proxy=http://localhost:7890
set https_proxy=http://localhost:7890

该三条指令都为临时变量,关掉命令行后都会失效。 

这里需要使用代理否则无法进行后面的下载安装,代理的端口由自身使用的端口确定。

6. 安装 depot tools

在命令行中输入:

gclient

等待下载完毕,并安装

7. 配置 git
git config --global user.name "用户名"
git config --global user.email "邮箱"
git config --global core.autocrlf false
git config --global core.filemode false
git config --global branch.autosetuprebase always

这里必须需要一个 git 账号,输入用户名和邮箱

8. 下载 chromium

在命令行中输入:

mkdir chromium && cd chromium
fetch --no-history chromium
9. 构建 chromium

命令行中输入:

cd src
gn gen --ide=vs outDefault
gn args out/Default

出现一个文本文件,在里面添加以下参数

is_component_build = true
enable_nacl = false
target_cpu = "x86"
blink_symbol_level = 0
v8_symbol_level = 0
symbol_level = 0

 最后在命令行中输入:

set NINJA_SUMMARIZE_BUILD=1
autoninja -C outDefault chrome

输入以上参数和命令可以加快构建速度,否则会构建很久。

10. 打开 outDefault 中的 all.sln 项目解决方案

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/729671.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号