Skip to content

lightpanda-io/zig-v8-fork

Repository files navigation

zig-v8

Builds V8 from official source and provides C bindings and a Zig API. This would be used for embedding the V8 runtime into your Zig or C ABI compatible projects.

V8 is the JS/WASM runtime that powers Google Chrome and Microsoft Edge.

System Requirements

  • Zig compiler (0.14.0). Clone and build https://github.com/ziglang/zig.
  • Python 3 (2.7 seems to work as well)
  • unzip (apt install unzip)
  • For native macOS builds:
    • XCode (You won't need this when using zig's c++ toolchain!)
      if you come across this error:
      xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
      run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Build

Compiling v8 will take 20+ minutes.

zig build get-v8
zig build build-v8

Once complete, you can find v8 in: v8/out/debug/obj/zig/libc_v8.a

If you build with zig build -Doptimize=ReleaseFast build-v8, v8 will be in v8/out/release/obj/zig/libc_v8.a.