v8引擎编译全过程

环境vs2019  

cmd 命令行需要设置成为代理模式

set http_proxy=http://127.0.0.1:10809
set https_proxy=http://127.0.0.1:10809

这个必须带上,不然报错,告诉编译器win系统的模式
set DEPOT_TOOLS_WIN_TOOLCHAIN=0 

源码

GitHub: GitHub - v8/v8: The official mirror of the V8 Git repository.

创建V8文件夹

下载depot_tools工具,并添加到系统环境变量之中

git clone https://chromium.googlesource.com/chromium/tools/depot_tools
 

重新开CMD命令行

set DEPOT_TOOLS_WIN_TOOLCHAIN=0 

fetch v8
gclient sync
拉取V8代码

编译过程

set "GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
set "WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10"
set "vs2019_install=C:\Program Files (x86)\Microsoft Visual Studio\2019"
set DEPOT_TOOLS_WIN_TOOLCHAIN=0


python build\vs_toolchain.py update --force

gn gen out.gn/ia32.release --args="is_debug=false target_cpu=\"ia32\" v8_static_library=true v8_use_external_startup_data=false v8_use_snapshot=false"

编译V8:使用ninja工具来编译V8。你可以使用以下命令来编译:

ninja -C out.gn/ia32.release v8


v8引擎编译全过程_第1张图片

v8引擎编译全过程_第2张图片

生成DLL:编译完成后,就得到了V8DLL 

你可能感兴趣的:(易/C++开发,JS逆向,c++,javascript)