Sorry I should have explained the setup a little better.
I'm not using Make itself to build V8 (or my own project), but we use Make 
as an outer wrapper around GN calls for convenience. 

So our current build ends up doing something like this:
# make -C /depot/vendor/v8
/depot/vendor/v8 $ gn gen out.gn/x64.release
/depot/vendor/v8 $ ninja -C out.gn/x64.release
# make -C /depot/foo
/depot/foo $ gn gen /depot/out/Default ...
/depot/foo $ ninja -C /depot/out/Default ...

I want to eliminate the Make component entirely and have V8 be built as a 
proper dependency in the larger GN project.
That's why I tried to add V8 as a deps target to our project. But that 
doesn't seem to be working because of the error in my original message.



On Thursday, January 6, 2022 at 10:55:02 AM UTC-8 dcer...@gmail.com wrote:

> Perhaps you should be building the V8 repo with GN (not Make) as a 
> submodule of your git project.
>
> The docs are here:
> https://v8.dev/docs/build-gn
>
> There are two scripts in the V8 repo that do the heavy lifting:
> v8gen.py (generates build files from configs)
> gm.py (runs the resulting build and most importantly installs all the 
> resulting artifacts in the right places)
>
> I worked on a project recently that had forked V8 and built in a separate 
> project and then imported the static library, etc into a CMAKE build that 
> did not use submodules.
> That was very hard to maintain.
>
>
> On Wednesday, January 5, 2022 at 12:09:38 AM UTC-5 da...@extrahop.com 
> wrote:
>
>> Hopefully this isn't off topic since it's more about GN than V8, but 
>> figured y'all might have some ideas.
>>
>> We're using GN as our build system for a project which embeds V8. Right 
>> now have the V8 repo living under our project's repo at /depot/vendor/v8. 
>> We build the V8 static library separately (using Make) and then link it 
>> into our project using GN: 
>>
>> executable("foo") {
>> libs = [ "/depot/vendor/v8/out.gn/x64.release/obj/libwee8.a" ]
>> }
>>
>> I'd like to do it "correctly" and add V8 as a dependency to our project 
>> via GN, but I'm unsure how to do it without mucking around in V8's 
>> BUILD.gn files too much. I tried directly adding V8 as a dependency:
>> executable("foo") {
>> deps = [ "//vendor/v8:wee8" ]
>> }
>>
>> But then get an error about missing files under //build:
>> $ gn gen  /depot/out/Default ...
>> ERROR at //vendor/v8/BUILD.gn:5:1: Can't load input file.
>> import("//build/config/arm.gni")
>> ^------------------------------
>> Unable to load:
>>   /depot/build/config/arm.gni
>>
>> It should be looking at /depot/vendor/v8/build/config/arm.gni instead.
>> To my unfamiliar eye it seems like V8 expects itself to be the root of 
>> the project, not in a sub-directory.
>>
>> Is there any way to tell the V8 targets that it should "rebase" its file 
>> references and whatnot into its sub-directory without making edits to V8's 
>> BUILD.gn files directly? It'd make upgrading V8 a pain if we have to 
>> apply a bunch of build modifications on top of it.
>>
>> Thanks so much!
>>
>

-- 
-- 
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/081f1b01-b41d-41ac-9bb9-e412c37b1987n%40googlegroups.com.

Reply via email to