vs2013 v8编译
来源:互联网 发布:龙腾世纪审判 知乎 编辑:程序博客网 时间:2024/05/16 07:03
最新v8,只能在vs2015编译(在官网看了资料,新版本v8/chrome使用的c++11特性只能用vs2015编译)
vs2015 vc需要的dll有近50个,发布不太方便,所以采用vs2013update5编译
版本发布日期 5.8.3012017.3.1 5.7.5142017.1.19 5.6.3312016.11.17vs2013支持的最后版本5.5.3832016.10.6 5.4.5242016.8.25 5.3.351 2016.6.30 5.2.3712016.5.19winxp支持的最后版本,vs2013编译5.1.3002016.4.11 5.0.1042016.2.26 4.10.2532016.2.17 4.9.3912016.1.15 4.8.2942015.12.13 4.7.842015.10.2 4.6.882015.8.21
为了避坑,采用5.6.331, 这是vs2013update5能支持的最后版本,再之后的需要c++11 full support,也就是vs2015了
=================不太华丽的分割线=================
1.下载gclient(可以安装到任意地方,和v8源代码无关)
git config --global http.proxy "127.0.0.1:1080"
git config --global https.proxy "127.0.0.1:1080"
set http_proxy=http://127.0.0.1:1080
set https_proxy=https://127.0.0.1:1080
cd D:\sdk
git clone https://chromium.googlesource.com/chromium/tools/depot_tools
把D:\sdk\depot_tools加到环境变量PATH中
(这里有现成的下载depot_tools.zip:https://www.chromium.org/developers/how-tos/install-depot-tools)
(我下载了一份最新的完整版,放到csdn了:http://download.csdn.net/detail/jinglexy/9791996)
2.更新gclient
重新开一个命令行窗口(需要管理员权限)
gclient
gclient --version
这个指令运行必须运行正常,否则后面的无意义
3.安装python-2.7.13(加入PATH环境变量),注意这个不是depot_tools里面的python
注意:命令行运行where python必须指向c:\python27,如果是depot_tools会出错
where python
python -m pip install -U pip setuptools
git clone https://github.com/svn2github/gyp && cd gyp && python setup.py install
4.下载v8
下载:https://github.com/v8/v8/releases/tag/5.6.331,并解压
把脚本sync_3rd_5.6.331.bat拷贝到源码文件夹,并执行,会更新所有第三方依赖
脚本下载地址:https://github.com/wjx0912/CppBaseUtils
5.编译(where python确保指向C:\Python27\python.exe)
cd D:\sdk\2013\v8-5.6.331
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2013
python gypfiles\gyp_v8.py -Dtarget_arch=ia32 -f msvs -Dcomponent=shared_library
用vs2013打开src/v8.sln,修改项目属性v8_base_0, v8_base_1, v8_base_2, v8_base_3:
项目->属性->C++: 将警告视为错误,改为否,然后开始编译win32的debug/release,
属性表请参考github项目 :https://github.com/wjx0912/CppBaseUtils
github项目 :https://github.com/wjx0912/CppBaseUtils
一份已经编译好h/lib/dll的放到csdn了:
http://download.csdn.net/detail/jinglexy/9793531
http://download.csdn.net/detail/jinglexy/9793533