Compile V8 engine steps with Visual Studio 2010 and 2013

  • 2020-04-02 03:12:09
  • OfStack

Compile the V8 engine using Visual Studio 2013


Preparation, installation Python2.x . git . svn :

Git: http://msysgit.github.io
SVN:http://www.sliksvn.com/en/download
Python:https://www.python.org/downloads/

Step one, get V8 Source:
https://github.com/v8/v8-git-mirror

Step two, get cygwin And put it V8 Under the source of third_party Folders:
svn co http://src.chromium.org/svn/trunk/deps/third_party/cygwin third_party/cygwin Step three, get ICU And put it V8 Under the source of third_party Folders:
svn co https://src.chromium.org/chrome/trunk/deps/third_party/icu46 third_party/icu

Step 4: generate project files:

python buildgyp_v8

Step five, use VS2013 Open the all.sln To compile

other JavaScript Engine: http://en.wikipedia.org/wiki/List_of_ECMAScript_engines

Compile v8 engine -with visual studio 2010 under Windows

Download:

1. Find the Google site where you downloaded the source code.
2. Prompt to use the SVN command to download the source file. SVN stands for subversion. Download the subversion console client.
3. Execute the prompt and you can download it.

Compile:

1. Because it contains python code, please download and install the python script interpreter.
2. Open v8.sln in V8 tools visual_studio.
3. Add $(SystemRoot)\System32 and python interpreter to the path of executable file VC++ in Visual Studio 2010 development environment, such as: C:\ python 26. These paths are used at compile time.
4. First build v8_base, then buildv8. Sure.

This is the static library, large, if you want to compile the DLL, as follows:

1. Add the preprocessor BUILDING_V8_SHARED in v8_base and v8
2. Change v8 to dynamic link library (v8 Property Pages-) > The Configuration Properties - > General - > The Configuration Type)
3. Add $(OutDir)\lib to v8 Additional Library Directories
4. Add v8_base.lib ws2_32.lib winmm.lib to v8 Additional Dependencies.
5. Compile v8_base and v8, respectively.

After this operation, some still can't compile the v8 engine successfully, then you can use the following method to compile

1, install python
2. Install version scons 1.0 or above
3. Open CMD, into your v8 source directory
4. Input
CMD ""C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat""
5. Input
Scons mode = debug library = Shared snapshot = on
6. This will generally compile successfully
Shouldn't be a problem.

You only need to use v8.h, v8.lib, v8.dll.


Related articles: