vs2013 v8編譯

最新v8,只能在vs2015編譯(在官網看了資料,新版本v8/chrome使用的c++11特性只能用vs2015編譯)python

vs2015 vc須要的dll有近50個,發佈不太方便,因此採用vs2013update5編譯c++

 

版本 發佈日期  
5.8.301 2017.3.1  
5.7.514 2017.1.19  
5.6.331 2016.11.17 vs2013支持的最後版本
5.5.383 2016.10.6  
5.4.524 2016.8.25  
5.3.351  2016.6.30  
5.2.371 2016.5.19 winxp支持的最後版本,vs2013編譯
5.1.300 2016.4.11  
5.0.104 2016.2.26  
4.10.253 2016.2.17  
4.9.391 2016.1.15  
4.8.294 2015.12.13  
4.7.84 2015.10.2  
4.6.88 2015.8.21  

爲了避坑,採用5.6.331, 這是vs2013update5能支持的最後版本,再以後的須要c++11 full support,也就是vs2015了git

=================不太華麗的分割線=================github

 

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)chrome

(我下載了一份最新的完整版,放到csdn了:http://download.csdn.net/detail/jinglexy/9791996)svn

2.更新gclient
從新開一個命令行窗口(須要管理員權限)
gclient
gclient --version
這個指令運行必須運行正常,不然後面的無心義google

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 installspa

 

4.下載v8.net

下載: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

相關文章
相關標籤/搜索