This packages contain prebuilt V8 binaries, debug symbols, headers and libraries required to embed the V8 JavaScript engine into a C++ project.
To use V8 in a project install the package v8-$PlatformToolset-$Platform.$Version
from a console with nuget install command or from inside of Visual Studio
(see menu option Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution...)
where
-
$PlatformToolsetis the C++ toolset version used in Visual Studio:v120- for Visual Studio 2013v140- for Visual Studio 2015v141- for Visual Studio 2017v142- for Visual Studio 2019v143- for Visual Studio 2022v120_xp- for Visual Studio 2013 XP platform toolsetv140_xp- for Visual Studio 2015 XP platform toolsetv141_xp- for Visual Studio 2017 XP platform toolset
-
$Platformis a target platform type, currentlyx86orx64. -
$Versionis the actual V8 version, one of https://chromium.googlesource.com/v8/v8.git/+refs
There are 3 package kinds:
-
v8-$PlatformToolset-$Platform.$Version- contains developer header and library files; depends onv8.redistpackage -
v8.redist-$PlatformToolset-$Platform.$Version- prebuilt V8 binaries: dlls, blobs, etc. -
v8.symbols-$PlatformToolset-$Platform.$Version- debug symbols for V8: pdb files
After successful packages installation add #include <v8.h> in a C++ project
and build it. All necessary files (*.lib, *.dll, *.pdb) would be referenced
in the project automatically with MsBuild property sheets.
This section is mostly for the package maintainers who wants to update V8.
Tools required to build V8 NuGet package on Windows:
- Visual C++ toolset (version >=2022)
- Python 3.x
- Git >= 1.9
- NuGet (https://dist.nuget.org/index.html)
To build V8 and make NuGet packages:
- Run
build.pywith optional command-line arguments. - Publish
nuget/*.nupkgfiles after successful build.
Build script build.py supports command-line arguments to specify package build options:
- V8 version branch/tag name
--version, default islkgrbranch (last known good revision) - Platform
--platform, default are both [x86,x64] - Configuration
--config, default are both [Debug,Release] - Libraries kind
--libs, default are both [shared,monolith] (i.e. dll and static libs) - Additional V8 gn options
--gn-optionin key=value format - Print all available options with
--helpswitch
For example, to build V8 version 12.8 for x64 dlls, both debug and release run it as:
python3 build.py --version=12.8 --platform=x64 --libs=shared