Google V8 - v8.dll 和 v8.dll.lib 都没有在发布模式中构建 [英] Google V8 - Neither v8.dll nor v8.dll.lib getting built in release mode

查看:32
本文介绍了Google V8 - v8.dll 和 v8.dll.lib 都没有在发布模式中构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照 使用 GN 构建 说明进行构建使用 Visual Studio 2015 在 Windows 10 上运行 Google V8.我做了什么:

I've followed the Building with GN instructions to build Google V8 on Windows 10 with Visual Studio 2015. What I did:

下载并解压 depot-tools 后获得 V8.

Getting V8, after downloading and unpacking the depot-tools.

C:\build-depot> set DEPOT_TOOLS_WIN_TOOLCHAIN=0
C:\build-depot> gclient
C:\build-depot> set GYP_MSVS_VERSION=2015
C:\build-depot> fetch v8

正在生成构建文件...

Generating build files...

C:\build-depot\v8> python tools\dev\v8gen.py x64.debug
C:\build-depot\v8> python tools\dev\v8gen.py x64.release

...并编译

C:\build-depot\v8> ninja -C out.gn\x64.debug
C:\build-depot\v8> ninja -C out.gn\x64.release

调试模式下生成的静态库:

Static libraries generated in debug mode:

C:\depot_tools\v8\out.gn\x64.debug>dir /s/b *.lib
C:\depot_tools\v8\out.gn\x64.debug\cctest.lib
C:\depot_tools\v8\out.gn\x64.debug\icui18n.dll.lib
C:\depot_tools\v8\out.gn\x64.debug\icuuc.dll.lib
C:\depot_tools\v8\out.gn\x64.debug\mkpeephole.lib
C:\depot_tools\v8\out.gn\x64.debug\mksnapshot.lib
C:\depot_tools\v8\out.gn\x64.debug\v8.dll.lib
C:\depot_tools\v8\out.gn\x64.debug\v8_libbase.dll.lib
C:\depot_tools\v8\out.gn\x64.debug\v8_libplatform.dll.lib
C:\depot_tools\v8\out.gn\x64.debug\obj\build\config\sanitizers\options_sources.lib
C:\depot_tools\v8\out.gn\x64.debug\obj\testing\gmock\gmock.lib
C:\depot_tools\v8\out.gn\x64.debug\obj\testing\gmock\gmock_main.lib
C:\depot_tools\v8\out.gn\x64.debug\obj\testing\gtest\gtest.lib

发布模式下生成的静态库:

Static libraries generated in release mode:

C:\depot_tools\v8\out.gn\x64.release\obj\v8_libbase.lib
C:\depot_tools\v8\out.gn\x64.release\obj\v8_libplatform.lib
C:\depot_tools\v8\out.gn\x64.release\obj\build\config\sanitizers\options_sources.lib
C:\depot_tools\v8\out.gn\x64.release\obj\testing\gmock\gmock.lib
C:\depot_tools\v8\out.gn\x64.release\obj\testing\gmock\gmock_main.lib
C:\depot_tools\v8\out.gn\x64.release\obj\testing\gtest\gtest.lib
C:\depot_tools\v8\out.gn\x64.release\obj\third_party\icu\icui18n.lib
C:\depot_tools\v8\out.gn\x64.release\obj\third_party\icu\icuuc.lib

问题

正如您在上面的列表中看到的,v8.dll.lib 在调试模式下生成,但在发布模式下丢失,顺便说一句,对于 v8.dll.两个问题:

As you can see in the list above, v8.dll.lib is generated in debug mode, but is missing in release mode, which BTW is also true for v8.dll. Two questions:

  1. 为什么这些库不在发布模式下生成?
  2. 当这些库丢失时,我应该如何在发布模式下链接到 V8?

提前致谢!

推荐答案

默认情况下发布模式构建是静态链接的,而不是创建 v8.dll 共享库.您可以通过运行 gn args out.gn\x64.release 并添加行 is_component_build = true 来更改它,然后保存并关闭文件,然后重建.

Release mode builds are statically linked by default, as opposed to creating a v8.dll shared library. You can change that by running gn args out.gn\x64.release and adding the line is_component_build = true, then save and close the file, and rebuild.

这篇关于Google V8 - v8.dll 和 v8.dll.lib 都没有在发布模式中构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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