How do we build v8 using make/cmake?

1,061 views
Skip to first unread message

nikhil ap

unread,
Mar 7, 2018, 2:16:04 PM3/7/18
to v8-users
Hi Guys, 

I am planning to integrate v8 into my already existing project. Is there a way to build v8 using Makefiles and not ninja. Is there a way to generate Makefiles and just give make? 

Also, I have another project which is using Cmake. I guess since v8 uses depot_tools to fetch the sources, one option is to copy the source to a directory inside the project instead of specifying the project's git repo in CMakelist file. Is there a way to specify downloading the sources remotely using cmake? 


nikhil ap

unread,
Mar 7, 2018, 2:23:08 PM3/7/18
to v8-users
Also, I linking my application to v8 in an embedded environment. Does v8 depend on any external libraries other than glibc/musl ? 

Ben Noordhuis

unread,
Mar 10, 2018, 3:46:55 AM3/10/18
to v8-users
Hi, answers inline.

On Wed, Mar 7, 2018 at 8:16 PM, nikhil ap <niks...@gmail.com> wrote:
> I am planning to integrate v8 into my already existing project. Is there a
> way to build v8 using Makefiles and not ninja. Is there a way to generate
> Makefiles and just give make?

Short answer: no.

Longer answer: V8 until recently supported the GYP build tool. GYP
can generate Makefiles and CMakeList.txt files, although the cmake
support is basic bordering on rudimentary. Could be an option if you
don't need the latest and greatest.

Alternative longer answer: you could maintain your own build files.
More work but you're not beholden to V8's build system. Two examples:

1. https://github.com/bnoordhuis/io.js/tree/cmake/cmake/v8 (cmake-based)
2. https://github.com/bnoordhuis/v8.rs/commit/2a20ed0f5 (make-based)

On Wed, Mar 7, 2018 at 8:23 PM, nikhil ap <niks...@gmail.com> wrote:
> Also, I linking my application to v8 in an embedded environment. Does v8
> depend on any external libraries other than glibc/musl ?

The C++ runtime: libstdc++ or libc++.

libdl and librt if you count those as separate libraries (they're part
of glibc.)

nikhil ap

unread,
Mar 15, 2018, 10:52:36 AM3/15/18
to v8-u...@googlegroups.com
Thanks Ben. I integrated the v8 sources to my CMakefile. The project I am working on has libcxx with the compile time option set to LIBCPP_HAS_NO_THREADS  this results in build failure  because v8 includes atomic.h and stops with the error message
"atomic is not supported on this single threaded system" 

Is there a work-around for this issue? Will I be able to run v8 on a single threaded system? Can I also run node on a single threaded system? (albeit slower) 



--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to a topic in the Google Groups "v8-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/v8-users/YML96MBnugA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to v8-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Regards,
Nikhil
Reply all
Reply to author
Forward
0 new messages