├── .gitignore ├── v8.gclient ├── nuget ├── v8.symbols.props ├── v8.redist.props ├── v8.monolith.props ├── v8.props ├── v8.monolith.nuspec ├── v8.symbols.nuspec ├── v8.redist.nuspec └── v8.nuspec ├── .github └── workflows │ └── build.yml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /v8 2 | /v8*.nupkg 3 | *.pyc -------------------------------------------------------------------------------- /v8.gclient: -------------------------------------------------------------------------------- 1 | solutions = [ 2 | { 3 | "name": "v8", 4 | "url": "https://chromium.googlesource.com/v8/v8.git", 5 | "deps_file": "DEPS", 6 | "managed": False, 7 | "custom_deps": {}, 8 | }, 9 | ] 10 | -------------------------------------------------------------------------------- /nuget/v8.symbols.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /nuget/v8.redist.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /nuget/v8.monolith.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildThisFileDirectory)..\..\include;%(AdditionalIncludeDirectories) 5 | 6 | 7 | 8 | $(MSBuildThisFileDirectory)..\..\lib\$(Configuration);%(AdditionalLibraryDirectories) 9 | v8_monolith.lib;dbghelp.lib;shlwapi.lib;winmm.lib;%(AdditionalDependencies) 10 | 11 | 12 | -------------------------------------------------------------------------------- /nuget/v8.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildThisFileDirectory)..\..\include;%(AdditionalIncludeDirectories) 5 | 6 | 7 | 8 | $(MSBuildThisFileDirectory)..\..\lib\$(Configuration);%(AdditionalLibraryDirectories) 9 | v8.dll.lib;v8_libbase.dll.lib;v8_libplatform.dll.lib;dbghelp.lib;shlwapi.lib;winmm.lib;%(AdditionalDependencies) 10 | zlib.dll.lib 11 | 12 | 13 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build V8 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | version: 7 | description: 'V8 version' 8 | required: true 9 | 10 | 11 | jobs: 12 | build: 13 | runs-on: windows-latest 14 | strategy: 15 | matrix: 16 | platform: ['x64', 'x86'] 17 | lib: ['shared'] #, 'monolith'] 18 | name: Build V8 ${{ github.event.inputs.version }} ${{ matrix.platform }} 19 | steps: 20 | - name: Checkout 21 | uses: actions/checkout@v4 22 | - name: Setup Python 23 | uses: actions/setup-python@v4 24 | with: 25 | python-version: '3' 26 | - name: Setup NuGet 27 | uses: nuget/setup-nuget@v2 28 | with: 29 | nuget-api-key-source: https://api.nuget.org/v3/index.json 30 | nuget-api-key: ${{ secrets.NUGET_API_KEY }} 31 | - name: Enable Developer Command Prompt 32 | uses: ilammy/msvc-dev-cmd@v1 33 | with: 34 | vsversion: '2022' 35 | - name: Build 36 | run: python build.py --version=${{ github.event.inputs.version }} --platform=${{ matrix.platform }} --libs=${{ matrix.lib }} 37 | #- name: Store packages 38 | # uses: actions/upload-artifact@v2 39 | # with: 40 | # name: '8.4-${{ matrix.platform }}-${{ matrix.lib }}' 41 | # path: '*.nupkg' 42 | # continue-on-error: true 43 | - name: Publish on Nuget.org 44 | run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate 45 | -------------------------------------------------------------------------------- /nuget/v8.monolith.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | v8.monolith-$PlatformToolset$-$Platform$ 5 | $Version$ 6 | The V8 JavaScript Engine Authors 7 | The V8 NuGet package Authors 8 | https://github.com/pmed/v8-nuget 9 | https://raw.githubusercontent.com/wiki/v8/v8/images/v8logo.png 10 | https://raw.githubusercontent.com/v8/v8/master/LICENSE.v8 11 | false 12 | Monolithic static library and headers for V8 JavaScript Engine. 13 | V8 javascript embedded native nativepackage 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /nuget/v8.symbols.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | v8.symbols-$PlatformToolset$-$Platform$ 5 | $Version$ 6 | The V8 JavaScript Engine Authors 7 | The V8 NuGet package Authors 8 | https://github.com/pmed/v8-nuget 9 | https://raw.githubusercontent.com/wiki/v8/v8/images/v8logo.png 10 | https://raw.githubusercontent.com/v8/v8/master/LICENSE.v8 11 | false 12 | Debug symbols for V8 JavaScript Engine redistrubutable files. 13 | V8 javascript embedded native nativepackage 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /nuget/v8.redist.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | v8.redist-$PlatformToolset$-$Platform$ 5 | $Version$ 6 | The V8 JavaScript Engine Authors 7 | The V8 NuGet package Authors 8 | https://github.com/pmed/v8-nuget 9 | https://raw.githubusercontent.com/wiki/v8/v8/images/v8logo.png 10 | https://raw.githubusercontent.com/v8/v8/master/LICENSE.v8 11 | false 12 | Prebuild binaries for V8 JavaScript Engine. 13 | V8 javascript embedded native nativepackage 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /nuget/v8.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | v8-$PlatformToolset$-$Platform$ 5 | $Version$ 6 | The V8 JavaScript Engine Authors 7 | The V8 NuGet package Authors 8 | https://github.com/pmed/v8-nuget 9 | https://raw.githubusercontent.com/wiki/v8/v8/images/v8logo.png 10 | https://raw.githubusercontent.com/v8/v8/master/LICENSE.v8 11 | false 12 | Developer files (headers/libraries) for V8 JavaScript Engine. 13 | V8 javascript embedded native nativepackage 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NuGet package for V8 JavaScript Engine 2 | 3 | This packages contain prebuilt V8 binaries, debug symbols, headers and 4 | libraries required to embed the V8 JavaScript engine into a C++ project. 5 | 6 | | Package | Version 7 | |-----------------------------|----------------------------------------------------------------------------------------------------------------------| 8 | |V8 x64 for Visual Studio 2022|[![NuGet](https://img.shields.io/nuget/v/v8-v143-x64.svg)](https://www.nuget.org/packages/v8-v143-x64/)| 9 | |V8 x86 for Visual Studio 2022|[![NuGet](https://img.shields.io/nuget/v/v8-v143-x86.svg)](https://www.nuget.org/packages/v8-v143-x86/)| 10 | |V8 x64 for Visual Studio 2019|[![NuGet](https://img.shields.io/nuget/v/v8-v142-x64.svg)](https://www.nuget.org/packages/v8-v142-x64/)| 11 | |V8 x86 for Visual Studio 2019|[![NuGet](https://img.shields.io/nuget/v/v8-v142-x86.svg)](https://www.nuget.org/packages/v8-v142-x86/)| 12 | |V8 x64 for Visual Studio 2017|[![NuGet](https://img.shields.io/nuget/v/v8-v141-x64.svg)](https://www.nuget.org/packages/v8-v141-x64/)| 13 | |V8 x86 for Visual Studio 2017|[![NuGet](https://img.shields.io/nuget/v/v8-v141-x86.svg)](https://www.nuget.org/packages/v8-v141-x86/)| 14 | |V8 x64 for Visual Studio 2015|[![NuGet](https://img.shields.io/nuget/v/v8-v140-x64.svg)](https://www.nuget.org/packages/v8-v140-x64/)| 15 | |V8 x86 for Visual Studio 2015|[![NuGet](https://img.shields.io/nuget/v/v8-v140-x86.svg)](https://www.nuget.org/packages/v8-v140-x86/)| 16 | |V8 x64 for Visual Studio 2013|[![NuGet](https://img.shields.io/nuget/v/v8-v120-x64.svg)](https://www.nuget.org/packages/v8-v120-x64/)| 17 | |V8 x86 for Visual Studio 2013|[![NuGet](https://img.shields.io/nuget/v/v8-v120-x86.svg)](https://www.nuget.org/packages/v8-v120-x86/)| 18 | |V8 x64 for Visual Studio 2017 XP platform toolset|[![NuGet](https://img.shields.io/nuget/v/v8-v141_xp-x64.svg)](https://www.nuget.org/packages/v8-v141_xp-x64/)| 19 | |V8 x86 for Visual Studio 2017 XP platform toolset|[![NuGet](https://img.shields.io/nuget/v/v8-v141_xp-x86.svg)](https://www.nuget.org/packages/v8-v141_xp-x86/)| 20 | |V8 x64 for Visual Studio 2015 XP platform toolset|[![NuGet](https://img.shields.io/nuget/v/v8-v140_xp-x64.svg)](https://www.nuget.org/packages/v8-v140_xp-x64/)| 21 | |V8 x86 for Visual Studio 2015 XP platform toolset|[![NuGet](https://img.shields.io/nuget/v/v8-v140_xp-x86.svg)](https://www.nuget.org/packages/v8-v140_xp-x86/)| 22 | |V8 x64 for Visual Studio 2013 XP platform toolset|[![NuGet](https://img.shields.io/nuget/v/v8-v120_xp-x64.svg)](https://www.nuget.org/packages/v8-v120_xp-x64/)| 23 | |V8 x86 for Visual Studio 2013 XP platform toolset|[![NuGet](https://img.shields.io/nuget/v/v8-v120_xp-x86.svg)](https://www.nuget.org/packages/v8-v120_xp-x86/)| 24 | 25 | 26 | ## Usage 27 | 28 | To use V8 in a project install the package `v8-$PlatformToolset-$Platform.$Version` 29 | from a console with `nuget install` command or from inside of Visual Studio 30 | (see menu option *Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution...*) 31 | where 32 | 33 | * `$PlatformToolset` is the C++ toolset version used in Visual Studio: 34 | * `v120` - for Visual Studio 2013 35 | * `v140` - for Visual Studio 2015 36 | * `v141` - for Visual Studio 2017 37 | * `v142` - for Visual Studio 2019 38 | * `v143` - for Visual Studio 2022 39 | * `v120_xp` - for Visual Studio 2013 XP platform toolset 40 | * `v140_xp` - for Visual Studio 2015 XP platform toolset 41 | * `v141_xp` - for Visual Studio 2017 XP platform toolset 42 | 43 | * `$Platform` is a target platform type, currently `x86` or `x64`. 44 | 45 | * `$Version` is the actual V8 version, one of https://chromium.googlesource.com/v8/v8.git/+refs 46 | 47 | There are 3 package kinds: 48 | 49 | * `v8-$PlatformToolset-$Platform.$Version` - contains developer header and 50 | library files; depends on `v8.redist` package 51 | 52 | * `v8.redist-$PlatformToolset-$Platform.$Version` - prebuilt V8 binaries: 53 | dlls, blobs, etc. 54 | 55 | * `v8.symbols-$PlatformToolset-$Platform.$Version` - debug symbols for V8: 56 | [pdb files](https://en.wikipedia.org/wiki/Program_database) 57 | 58 | After successful packages installation add `#include ` in a C++ project 59 | and build it. All necessary files (*.lib, *.dll, *.pdb) would be referenced 60 | in the project automatically with MsBuild property sheets. 61 | 62 | 63 | ## How to build 64 | 65 | This section is mostly for the package maintainers who wants to update V8. 66 | 67 | Tools required to build V8 NuGet package on Windows: 68 | 69 | * Visual C++ toolset (version >=2022) 70 | * Python 3.x 71 | * Git >= 1.9 72 | * NuGet (https://dist.nuget.org/index.html) 73 | 74 | To build V8 and make NuGet packages: 75 | 76 | 1. Run `build.py` with optional command-line arguments. 77 | 2. Publish `nuget/*.nupkg` files after successful build. 78 | 79 | Build script `build.py` supports command-line arguments to specify package build options: 80 | 81 | 1. V8 version branch/tag name `--version`, default is `lkgr` branch (last known good revision) 82 | 2. Platform `--platform`, default are both [`x86`, `x64`] 83 | 3. Configuration `--config`, default are both [`Debug`, `Release`] 84 | 4. Libraries kind `--libs`, default are both [`shared`, `monolith`] (i.e. dll and static libs) 85 | 5. Additional V8 gn options `--gn-option` in key=value format 86 | 6. Print all available options with `--help` switch 87 | 88 | For example, to build V8 version 12.8 for x64 dlls, both debug and release run it as: 89 | 90 | ``` 91 | python3 build.py --version=12.8 --platform=x64 --libs=shared 92 | ``` 93 | --------------------------------------------------------------------------------