Using VS2015 to compile V8 JavaScript engine (v5.5-2016/09) under Windows

Source: Internet
Author: User

Today's whim, download the V8, and then think about using vs compile

But everyone is upset that V8 does not directly provide a project file and solution (. sln) for VS

So, search on the internet to search, toss to toss to go;

Finally 1.1-point attempt to execute python gypfiles\gyp_v8.py-dtarget_arch=x64

But the search on the internet is Python build\gyp_v8.py-dtarget_arch=x64

But I git clone does not have a build folder Ah, at least according to

https://github.com/v8/v8/wiki/building-with-gyp-(deprecated) #visual-studio

said in the Gypfiles directory found, but execute command, CPU crazy a burst, after an out of the directory, what Sln,vcxproj a did not see

depressed,

,

,

And then all the way down, churning around, looking at different, related or even noun explanations

Until more than 4 o'clock in the afternoon, search the Internet "GYPFILES\GYP_V8", in the list see node. js even downloaded its source code with the V8 test inside, also not, and finally still nothing

Then turned over the search results, see the Gyp Grammar Rules Reference & tool use (note 1), eh!? Look, maybe we can find something useful.

So I went in and browsed, and when I finally saw the GYP command line parameter --f , this might be useful, test it quickly,

--fmsvs errors do not know the parameters,

Change it, please.

-F MSVs

Ha, haha different output, can't find the file under testing!!! Looks like a chance,

Look, texting directory,

Alas!!! Isn't that a vcxproj file, isn't it a sln file!!!!!!!!

See if the V8 project file has been created,

v8/No

V8/build/No

V8/gypfiles/Oh oh, with!!! With the:)

V8/src/also has V8.sln and other project documents!!!!

Done!

It's been a day, haven't you!!!!

Here is a summary of my steps.

1.Download and install Python2.download Gyp and install2.1 Downloads Gyp,to a directory git clone https:github.com/svn2github/Gyp can also be downloaded from the V8 affiliate program(see 3.1) 2.2Install Gup Execute python setup in the Gyp directory.py Install3Download V8 and affiliate Programs3.1download V8 git clone https:chromium.googlesource.com/v8/V8 git clone https:Chromium.googlesource.com/external/gyp.git./v8/tools/GypNeed to install Gyp ^python setup.py install^ git clone https:Chromium.googlesource.com/chromium/deps/icu.git./v8/third_party/ICU^icu relatively large (125M)^ git clone https:Chromium.googlesource.com/chromium/src/tools/clang.git./v8/tools/clanggit clone https://chromium.googlesource.com/external/github.com/google/googletest.git./v8/testing/rename goog Letest gtest//renaming git clone https://chromium.googlesource.com/chromium/deps/cygwin.git./v8/third_party/Cygwin 
//git clone https://chromium.googlesource.com/chromium/src/build.git./v8/ Build  4.  Create vs Project Project  4.1 set  depot_tools_win_toolchain=0 set  gyp_msvs_version=2015//set  gyp_generators=ninja//Do not need// set  gyp_defines=component=shared_library//This does not need  4.2 execution in V8 directory,  Create vs solution Python Gypfiles  \gyp_v8.py-dtarget_arch=x64 -f MSVs 

Build DLL
Python gypfiles\gyp_v8.py-dtarget_arch=x64-dcomponent=shared_library-f MSVs
Generate Lib
Python gypfiles\gyp_v8.py-dtarget_arch=x64-f MSVs

-F MSVs <---Suddenly reminds me of a word: the Finishing touch!

And then compile, there's a pit, a bunch of bugs:

Fatal error C1083: Could not open include file: "Base/trace_event/common/trace_event_common.h": No such files or directory

Google and GitHub do not have this file, can not find

Finally think, download of node. js there is V8 so find something else really have,

So the entire base directory (in fact, there is such a file) directly copied to the V8 directory, and the SRC directory peer

All the properties of the project that start with V8 change the static library to a dynamic library , including Icuuc and icui18n, and then compile

It's very time-consuming, I'm quad-core, keep waiting,

There's another one:

2>parsing\parser.cc (1540): Error C2220: Warning is treated as error-no "object" file generated
2>parsing\parser.cc (1540): Warning C4819: The file contains characters that cannot be represented in the current code page (936). Please save the file in Unicode format to prevent data loss

Causes the next thousands of errors .... Shit, also a pit, can not stand, directly canceled the compilation (Ctrl+break) ...

Look, parser.cc file encoding is Unicode, the others are ansii encoding, anyway, there are only English characters, do not care about coding, and other like ANSII encoded

Compilation is slow, but the result is still a lot of errors, are almost the same error

C2220 errors, and other "Note: see Instantiation of a class template being compiled " warning remove compiled parameter/WX, change warning level, or even turn off warning,

First of all, wait for the day to be interested in the toss ....

If you know how to solve, please tell me, thank you!!!

This address: http://www.cnblogs.com/lzpong/p/5888289.html

[Note 1:GYP syntax rules reference & use of tools: http://www.cnblogs.com/x_wukong/p/4829598.html]

Using VS2015 to compile V8 JavaScript engine (v5.5-2016/09) under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.