vs2013 v8編譯


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

vs2015 vc需要的dll有近50個,發布不太方便,所以采用vs2013update5編譯

 

版本 發布日期  
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了

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

 

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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM