I had this same issue. I notice that v8_heap_base_headers is a header-only target in BUILD.gn, but it is defined as "v8_source_set()" which ends up as a lib.
If you change the line in BUILD.gn: v8_source_set("v8_heap_base_headers") { to v8_header_set("v8_heap_base_headers") { It is around the line 5544 or 5653 depending on which version you are looking at. It changes to a virtual target, doesn't build a lib, and works! Note that "gn" source_set() normally builds virtual targets, but the v8_source_set() seems to behave differently. On Monday, April 18, 2022 at 6:59:51 AM UTC+8 johannes.g...@gmail.com wrote: > Dear all, > > currently, I am experiencing problems building v8 as a static library on > Windows within a developer command prompt for VS 2022. > > Using the following args.gn > > is_debug = false > target_cpu = "x86" > v8_monolithic = true > v8_optimized_debug = false > is_component_build = false > v8_static_library = true > use_custom_libcxx = false > use_custom_libcxx_for_host = false > treat_warnings_as_errors = false > v8_enable_i18n_support = false > v8_use_external_startup_data = false > > I get the following error: > > FAILED: obj/v8_heap_base_headers.lib > ..\..\third_party\llvm-build\Release+Asserts\bin\lld-link.exe /lib > /OUT:obj/v8_heap_base_headers.lib /nologo /WX /ignore:4221 /llvmlibthin > @obj/v8_heap_base_headers.lib.rsp warning: no input files, not writing > output file pass /llvmlibempty to write empty .lib file, pass > /ignore:emptyoutput to suppress warning treating warning as error due to > /WX lld-link: error: lib failed > > When I add > > fatal_linker_warnings = false > > I get, later in the build process, > > [1743/2146] LINK v8_heap_base_unittests.exe v8_heap_base_unittests.exe.pdb > FAILED: v8_heap_base_unittests.exe v8_heap_base_unittests.exe.pdb > ..\..\third_party\llvm-build\Release+Asserts\bin\lld-link.exe > /OUT:./v8_heap_base_unittests.exe /nologo > -libpath:..\..\third_party\llvm-build\Release+Asserts\lib\clang\15.0.0\lib\windows > > "-libpath:../../../../../../../Program Files (x86)/Windows > Kits/NETFXSDK/4.8/lib/um/x86" "-libpath:../../../../../../../Program Files > (x86)/Windows Kits/10/lib/10.0.20348.0/ucrt/x86" > "-libpath:../../../../../../../Program Files (x86)/Windows > Kits/10/lib/10.0.20348.0/um/x86" /MACHINE:X86 > /PDB:./v8_heap_base_unittests.exe.pdb @./v8_heap_base_unittests.exe.rsp > lld-link: error: could not open 'obj/v8_heap_base_headers.lib': no such > file or directory > [1747/2146] CXX obj/third_party/inspector_protocol/crdtp_test/json_test.obj > ninja: build stopped: subcommand failed. > > How can I get a monolithic static v8 library on Windows? The last time I > did this is about 2 years ago, with the then current version of the v8 > source, and then it worked without any problems. What am I doing wrong? > > Any help is most appreciated. > > Best regards, > Johannes > -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/a895c187-0829-4d88-935a-32b83e206ddcn%40googlegroups.com.