你如何用 Visual Studio 编译 V8? [英] How do you compile V8 with Visual Studio?

查看:44
本文介绍了你如何用 Visual Studio 编译 V8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试编译 V8.我已经从 GitHub 获得了 v8-master 文件夹的副本,但我不知道如何编译它.我在网上能找到的很多文档都是相互矛盾的.

I've been trying to compile V8. I've obtained a copy of the v8-master folder from GitHub, but I can't figure out how to compile it. A lot of the documentation I could find online are conflicting.

从我收集到的信息来看,似乎我编译它的最佳机会(在我找到的各种方法中,但我无法让它们中的任何一个工作)是创建项目通过调用 gyp_v8 脚本(位于 v8-master 的 build 文件夹中)来创建文件.但它只是给了我 File "gyp_v8", line 86 print 'Error running GYP' SyntaxError: Missing parentheses in call to 'print'.从那里,我尝试安装 Gyp(因为根据文档,我相信这就是导致错误的原因).这需要我安装 depot_tools 并执行 gclient sync.失败,错误 Error: client not configured;请参阅gclient 配置".并且 gclient config 失败,错误是 gclient.py: error: Inconsistency arguments.使用 --spec 或一个或两个参数.

From what I've gathered, it appears as if my best chance of getting it to compile (out of the various methods I've found, though I couldn't get any of them to work) is to create the project files by calling the gyp_v8 script (located in the build folder of v8-master). But it simply gives me File "gyp_v8", line 86 print 'Error running GYP' SyntaxError: Missing parentheses in call to 'print'. From there, I tried to install Gyp (since according to the documentation, I'm led to believe that's what's causing the error). That required me to install depot_tools and do gclient sync. That failed with the error Error: client not configured; see 'gclient config'. And gclient config fails with the erropr gclient.py: error: Inconsistency arguments. Use either --spec or one or 2 args.

老实说,我现在迷路了.有什么办法可以只使用 CMake 之类的吗?或者至少是一个构建教程,它不假设您有一堆特定于 Google 的构建工具?

Honestly, I'm lost at this point. Is there any way I could just use CMake or something? Or at least a build tutorial that doesn't assume you have a bunch of Google-specific build tools involved?

推荐答案

  1. 确认 Git 已安装.推荐使用 git 2.2.1+.
  2. 暂时禁用 Windows 索引.
  3. 安装Microsoft Visual C++ 2008 Redistributable Package"
  4. 以管理员身份运行bat文件
  1. Confirm Git is installed. git 2.2.1+ recommended.
  2. Temporarily, disable Windows Indexing.
  3. Install "Microsoft Visual C++ 2008 Redistributable Package"
  4. Run bat file as administrator

Bat 文件:

@echo on

CD /D %~dp0
SET DEPOT_TOOLS_WIN_TOOLCHAIN=0
SET DEPOT_TOOLS=%CD%/depot_tools
SET PYTHONHOME=%DEPOT_TOOLS%/python276_bin
SET PYTHONPATH=%CD%/v8/build/gyp
SET PATH=%DEPOT_TOOLS%;%PYTHONHOME%;%PATH%

SET GYP_DEFINES=target_arch=x64
REM SET GYP_DEFINES=target_arch=x64 component=shared_library v8_use_snapshot=false
REM About GYP_DEFINES: https://github.com/v8/v8/wiki/Building-with-Gyp

IF EXIST %DEPOT_TOOLS% (
  ECHO Updating depot_tools
  CD %DEPOT_TOOLS%
  CALL git pull
  CD ..
) ELSE (
  ECHO Getting depot_tools
  CALL git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
)

CALL gclient
CALL gclient config https://chromium.googlesource.com/v8/v8.git
CALL gclient sync

这篇关于你如何用 Visual Studio 编译 V8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆