Google V8 - Neither v8.dll nor v8.dll.lib getting built in release mode

放肆的年华 提交于 2021-01-29 03:24:52

问题


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

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

... and compiling

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

Problem

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. Why aren't these libraries generated in release mode?
  2. How should I link against V8 in release mode, when these libs are missing?

Thanks in advance!


回答1:


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.



来源:https://stackoverflow.com/questions/41199892/google-v8-neither-v8-dll-nor-v8-dll-lib-getting-built-in-release-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!