win10 编译V8引擎

git config --global https.proxy https://127.0.0.1:10810
git config --global http.proxy http://127.0.0.1:10810

netsh winhttp set proxy 127.0.0.1:10810

set http_proxy=http://127.0.0.1:10810
set https_proxy=https://127.0.0.1:10810

git config --global --unset http.proxy

git config --global --unset https.proxy

netsh winhttp reset proxy

set HTTP_PROXY=

set HTTPS_PROXY=

编译V8前将代理设置好,通过看程序端口可进行配置,没有就不要想编译v8了。

下载deptools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools

set DEPOT_TOOLS_WIN_TOOLCHAIN = 0
set GYP_MSVS_OVERRIDE_PATH = //安装路径
set GYP_MSVS_VERSION = 2017
set WINDOWSSDKDIR=D:\Windows Kits\10

备注:安装的sdk需要Debugging Tools for Windows,按理来说,Windows SDK是跟VS一起安装的,并没有给我配置的机会。那这个问题怎么解决呢?还是有办法的。打开“卸载或更改程序”,在里面找到“Windows Software Development Kit”,然后点击“修改”,然后选择“Change”,在里面把“Debugging Tools for Windows”打上勾,然后点击“change”,就好了
然后就是将deptools的路径加入path中。

fetch v8
cd v8
git checkout 8.8-lkgr
gclient sync -v

如果要更新工具,可以关闭 set DEPOT_TOOLS_UPDATE=0
这个就是代理未配置好导致无法更新的问题记住你的代理 可能更改端口一定要 出问题后查看端口是否改变。
python tools/dev/v8gen.py x64.debug -vv 查看具体错误。

  1. 如下问题:python 版本不对,
    在这里插入图片描述
  2. winsdk版本不对,别挣扎换正确版本,他指出了。
    在这里插入图片描述
  3. 别挣扎,需要改文件
    /third_party/googletest/BUILD.gn, visibility = [ " : *" ] 改为visibility = [ "*" ]解决。在这里插入图片描述
  4. 更新未到位,执行python build\util\lastchange.py build\util\LASTCHANGE解决
    在这里插入图片描述注意如果在期间出现任何问题 请先看下报错路径是否有文件,也许是下载文件不成功导致。如下:
    在这里插入图片描述根本没有这个文件。 重新下载…
1,singleByteCharCount这个报错 未使用 
	解决:在build/config/compiler/compiler.gni 中将treat_warnings_as_errors=true 修改为 false。
	
2,报错error: integer value 7 is outside the valid range of values 这个。
	解决:在build/config/compiler/BUILD.gn 中加入 -Wno-enum-constexpr-conversion即可解决。
	```
	if (is_clang && is_debug) {
    # Allow comparing the address of references and 'this' against 0
    # in debug builds. Technically, these can never be null in
    # well-defined C/C++ and Clang can optimize such checks away in
    # release builds, but they may be used in asserts in debug builds.
    cflags_cc += [
      "-Wno-undefined-bool-conversion",
      "-Wno-enum-constexpr-conversion",
      "-Wno-tautological-undefined-compare",
    ]
  }

1,singleByteCharCount这个报错 未使用 
	解决:在build/config/compiler/compiler.gni 中将treat_warnings_as_errors=true 修改为 false。
	
2,报错error: integer value 7 is outside the valid range of values 这个。
	解决:在build/config/compiler/BUILD.gn 中加入 -Wno-enum-constexpr-conversion即可解决。
	```
	if (is_clang && is_debug) {
    # Allow comparing the address of references and 'this' against 0
    # in debug builds. Technically, these can never be null in
    # well-defined C/C++ and Clang can optimize such checks away in
    # release builds, but they may be used in asserts in debug builds.
    cflags_cc += [
      "-Wno-undefined-bool-conversion",
      "-Wno-enum-constexpr-conversion",
      "-Wno-tautological-undefined-compare",
    ]
  }

参考:
https://blog.csdn.net/u011760195/article/details/109941227
https://blog.csdn.net/HermitSun/article/details/106091018

https://blog.csdn.net/liliangnike/article/details/109775254 写了很多错误解决办法
https://www.jianshu.com/p/8f35e19e6b03

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值