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/863f85ea-ca6a-45bc-b1fd-d688948438den%40googlegroups.com.

Reply via email to