如何在没有“外部启动数据"的情况下构建V8? [英] How to build V8 without "external startup data"?

查看:193
本文介绍了如何在没有“外部启动数据"的情况下构建V8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个独立的JavaScript库进行嵌入.我已经构建了V8,它可以正常工作,但是二进制文件需要两个外部数据"文件.我不要这个文件.

I want a standalone JavaScript library for embedding. I already build V8 and its working correctly, but binary needs two "external data" files. I don want this files.

我试图在没有外部启动数据"的情况下构建V8.我试图在build.common.gypi和build/standalone.gypi中将v8_use_external_startup_data设置为0,但是make在某些时候报告失败.

I was trying to build V8 without "external startup data". I tried to set v8_use_external_startup_data : 0, in build.common.gypi and build/standalone.gypi, but then make is reporting failure at some point.

我正在使用以下代码来构建v8:

I'm using following code to build v8:

git clone https://chromium.googlesource.com/chromium/tool/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
fetch v8
gclient sync
cd v8
git checkout branch-heads/5.1
# ... modifying gyni files
make x64.release -j 20

我正在使用默认的静态链接. 如何在不需要natives_blob.bin和snapshot_blog.bin的情况下构建V8?

I'm using default, static linking. How I can build V8 without need of natives_blob.bin and snapshot_blog.bin ?

推荐答案

在使用GYP构建过程时(如您所愿),在调用gyp时传递参数-Dv8_use_snapshot=false.这样就关闭了构建快照数据的过程,您将不需要"natives_blob.bin"和"snapshot_blob.bin".我的命令行如下所示(对于V8 5.3,n.b.GYP脚本最近已移动):

When using the GYP build process (as you seem to be), pass the argument -Dv8_use_snapshot=false when invoking gyp. That turns off building snapshot data, and you won't need "natives_blob.bin" and "snapshot_blob.bin". My command-line looks like this (for V8 5.3, n.b. the GYP scripts have moved recently):

python.exe gypfiles\gyp_v8 -Dtarget_arch=x64 -Dcomponent=shared_library -Dv8_enable_i18n_support=false -Dv8_use_snapshot=false -G msvs_version=2013

这篇关于如何在没有“外部启动数据"的情况下构建V8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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