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:
- Why aren't these libraries generated in release mode?
- How should I link against V8 in release mode, when these libs are missing?
Thanks in advance!
Release mode builds are statically linked by default, as opposed to creating a
v8.dllshared library. You can change that by runninggn args out.gn\x64.releaseand adding the lineis_component_build = true, then save and close the file, and rebuild.