How to build v8 as part of larger project using GN

143 views
Skip to first unread message

Ronald Fenner

unread,
Mar 7, 2020, 6:50:01 PM3/7/20
to v8-users
I'm using GN to build a project i'm starting on and I'm wondering ow to build v8 as part of it's source.
I've got it as a dependency in the DEPS file and paces at the root of the project like it is in chromium.

However there seems to be imports that reference gmock, various tools etc that i'd not like to have to add just to build v8 and i 
was wondering if there is a way to build it using GN like it was a standalone build and then pull the libraries in.

my BUILD.gn looks ike this at the moment


import("//build_overrides/build.gni")
import("//v8/gni/v8.gni")

executable("v8App") {
sources = [
"hello.cc"
]

cflags = ["-Wall"]
include_dirs=["."]
deps = [
"//v8:v8",
"//v8:v8_libbase",
        "//v8:v8_libplatform",
]
}

I'm currently trying to get the build system setup minimal to just compile the hello sample from v8.

I do have a number of other files setup like the .gn file to set the project root.

Is there a way to potetially remap //v8 to //?

Lars Magnusson

unread,
Dec 4, 2020, 4:34:27 AM12/4/20
to v8-users
I looking into the same problem. Did you manage to find out if this is possible?

Kind regards
Lars Magnusson

Victor Gomes

unread,
Dec 4, 2020, 9:46:36 AM12/4/20
to v8-u...@googlegroups.com
HI Ronald and Lars,

Here's an example of the hello world V8 embedder built with GN: https://github.com/victorgomes/v8-gn-example

Best,
Victor

--
--
v8-users mailing list
v8-u...@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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/81787438-9c0d-4a75-ba45-e106909de87bn%40googlegroups.com.


Victor Gomes

Software Engineer

victo...@google.com


Google Germany GmbH

Erika-Mann-Straße 33

80636 München


Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg


Diese E-Mail ist vertraulich. Falls Ssie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde. 

     

This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.


Lars Magnusson

unread,
Dec 4, 2020, 11:41:01 PM12/4/20
to v8-users
Thanks! 

-lars

Ronald Fenner

unread,
Dec 14, 2020, 12:07:01 PM12/14/20
to v8-u...@googlegroups.com
The problem I was having was trying to use GN to build my project and have it build v8 as part of that project like chromium. I could build v8 separately and in fact it's what I decided to do and jus package up the libraries and then link against them in the app I'm developing.

The problem when building as like s subproject it's path references when built as a sub project pointed in the main project which work for the chromium project but meant I had to start dragging in a lot of other stuff to support v8.

I also ended switching to using hazel for the build system.

Ronald Fenner
Network Architect
Game Circus LLC.


Reply all
Reply to author
Forward
0 new messages