Prebuilt V8 static libraries for embedding. Builds are automated via GitHub Actions and published as releases.
| Platform | Architecture | Release | Debug |
|---|---|---|---|
| Linux | x86_64, aarch64 | Yes | Yes |
| macOS | aarch64 | Yes | Yes |
| Windows | x86_64, aarch64 | Yes | No |
include(FetchContent)
FetchContent_Declare(
v8
GIT_REPOSITORY https://github.com/zyedidia/v8-build.git
GIT_TAG master
)
FetchContent_MakeAvailable(v8)
target_link_libraries(your_target PRIVATE v8::v8)To use a debug build:
cmake -B build -DV8_DEBUG=ON .This will automatically download the correct release from GitHub. If you have a
local build or manually downloaded the prebuilt version, you can use
V8_LOCAL_PATH to point CMake to that.
On Windows you also have to add
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
See examples/hello/ for a complete "hello world" example and
examples/advanced for more advanced examples.
See the GitHub Actions workflow for full details.
- Python 3
- Git
- Platform-specific:
- Linux: pkg-config, libglib2.0-dev
- macOS: Xcode command line tools
- Windows: Visual Studio 2022
# Clone V8 and dependencies
python clone.py --v8-version 14.0.365.10
# Build (release)
python build.py --args-gn args.gn --target-cpu x64 --install v8-install
# Build (debug)
python build.py --args-gn args.gn --target-cpu x64 --debug --install v8-installThe args.gn file contains GN build arguments. Flag-dependent arguments (is_debug, target_cpu, symbol_level, etc.) are automatically prepended by build.py.
See V8's GN args for available options.
The install directory contains:
libv8_monolith.a(orv8_monolith.libon Windows)libv8_libbase.a,libv8_libplatform.a(Linux only)include/- V8 headersargs.gn- Build configuration used