[v8-users] Embedding v8 in multi-platform application

2015-09-16 Thread Niklas Frisk
Hi,

I've recently been trying to embed v8 in a small c++ (c++11) application 
that's built for multiple platforms (linux, osx, possibly windows) and 
architectures (both x64 and arm). My initial plan was to build static 
libraries for all corresponding platforms, but I was unable to build static 
libraries on certain platforms (raspbian more specifically), and my OSX 
static libraries were roughly 512 mb. Having looked around here and various 
other places, the recommended approach seemed to be using a GYP dependency 
on v8 and it would just default to proper static linking 
(see 
https://groups.google.com/forum/#!searchin/v8-users/static$20linking/v8-users/98SA11GJgVA/_HLRRLPqmUQJ).
 
The recommended approach was to look at d8 and mimic how it handled the v8 
dependency. I am, however, unable to achieve this without v8's specific 
build flags and settings polluting my own applications build settings.

My project structure is basically as follows:
/
- myapp.gyp
- mylib.gyp #myapp depends on mylib
- common.gypi #common settings for myapp and mylib
- dep/
   - v8/ #V8 source tree

I then run the gyp included in the v8 source tree to generate make files 
for myapp.gyp. This then fails because standalone.gypi is not forcibly 
included, which is required for v8.gyp among many other files. Forcibly 
including this makes all the v8 targets work, but now myapp has its' 
configurations merged with standalone.gypi. 

My question is then rather simple - how is one supposed to integrate v8 
with static linking? Is there some way of achieving the standalone.gypi 
inclusion for only the v8 files, while leaving myapp untouched, preferably 
without altering the v8 source? I also noticed it had to use --depth=dep/v8 
for the gyp to work (which causes the build output to end up in the v8 out 
folder, rather than the root out folder).

Cheers!

-- 
-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Embedding v8 in multi-platform application

2015-09-16 Thread Jakob Kummerow
standalone.gypi, as the name implies, is intended for standalone V8 builds.
Embedders should provide corresponding definitions in their own GYP files
(e.g. their common.gypi). If you need a (big) example, look at Chromium's
common.gypi.

On Wed, Sep 16, 2015 at 4:29 PM, Niklas Frisk 
wrote:

> Hi,
>
> I've recently been trying to embed v8 in a small c++ (c++11) application
> that's built for multiple platforms (linux, osx, possibly windows) and
> architectures (both x64 and arm). My initial plan was to build static
> libraries for all corresponding platforms, but I was unable to build static
> libraries on certain platforms (raspbian more specifically), and my OSX
> static libraries were roughly 512 mb. Having looked around here and various
> other places, the recommended approach seemed to be using a GYP dependency
> on v8 and it would just default to proper static linking (see
> https://groups.google.com/forum/#!searchin/v8-users/static$20linking/v8-users/98SA11GJgVA/_HLRRLPqmUQJ).
> The recommended approach was to look at d8 and mimic how it handled the v8
> dependency. I am, however, unable to achieve this without v8's specific
> build flags and settings polluting my own applications build settings.
>
> My project structure is basically as follows:
> /
> - myapp.gyp
> - mylib.gyp #myapp depends on mylib
> - common.gypi #common settings for myapp and mylib
> - dep/
>- v8/ #V8 source tree
>
> I then run the gyp included in the v8 source tree to generate make files
> for myapp.gyp. This then fails because standalone.gypi is not forcibly
> included, which is required for v8.gyp among many other files. Forcibly
> including this makes all the v8 targets work, but now myapp has its'
> configurations merged with standalone.gypi.
>
> My question is then rather simple - how is one supposed to integrate v8
> with static linking? Is there some way of achieving the standalone.gypi
> inclusion for only the v8 files, while leaving myapp untouched, preferably
> without altering the v8 source? I also noticed it had to use --depth=dep/v8
> for the gyp to work (which causes the build output to end up in the v8 out
> folder, rather than the root out folder).
>
> Cheers!
>
> --
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Embedding v8 in multi-platform application

2015-09-16 Thread Niklas Frisk
This might be the wrong forum for this question but is there a way to avoid 
the required V8 variables etc affect my project? Currently the 
standalone.gypi is force included (which as far as I gather is to ensure v8 
and all it's dependents get the contents of standalone merged into their 
dictionaries)? This also has the downside of all of said settings affecting 
myapp. I might not want to build my project with the same warning flags as 
v8 for instance.

On Wednesday, September 16, 2015 at 5:15:17 PM UTC+2, Jakob Kummerow wrote:
>
> standalone.gypi, as the name implies, is intended for standalone V8 
> builds. Embedders should provide corresponding definitions in their own GYP 
> files (e.g. their common.gypi). If you need a (big) example, look at 
> Chromium's common.gypi.
>
> On Wed, Sep 16, 2015 at 4:29 PM, Niklas Frisk  > wrote:
>
>> Hi,
>>
>> I've recently been trying to embed v8 in a small c++ (c++11) application 
>> that's built for multiple platforms (linux, osx, possibly windows) and 
>> architectures (both x64 and arm). My initial plan was to build static 
>> libraries for all corresponding platforms, but I was unable to build static 
>> libraries on certain platforms (raspbian more specifically), and my OSX 
>> static libraries were roughly 512 mb. Having looked around here and various 
>> other places, the recommended approach seemed to be using a GYP dependency 
>> on v8 and it would just default to proper static linking (see 
>> https://groups.google.com/forum/#!searchin/v8-users/static$20linking/v8-users/98SA11GJgVA/_HLRRLPqmUQJ).
>>  
>> The recommended approach was to look at d8 and mimic how it handled the v8 
>> dependency. I am, however, unable to achieve this without v8's specific 
>> build flags and settings polluting my own applications build settings.
>>
>> My project structure is basically as follows:
>> /
>> - myapp.gyp
>> - mylib.gyp #myapp depends on mylib
>> - common.gypi #common settings for myapp and mylib
>> - dep/
>>- v8/ #V8 source tree
>>
>> I then run the gyp included in the v8 source tree to generate make files 
>> for myapp.gyp. This then fails because standalone.gypi is not forcibly 
>> included, which is required for v8.gyp among many other files. Forcibly 
>> including this makes all the v8 targets work, but now myapp has its' 
>> configurations merged with standalone.gypi. 
>>
>> My question is then rather simple - how is one supposed to integrate v8 
>> with static linking? Is there some way of achieving the standalone.gypi 
>> inclusion for only the v8 files, while leaving myapp untouched, preferably 
>> without altering the v8 source? I also noticed it had to use --depth=dep/v8 
>> for the gyp to work (which causes the build output to end up in the v8 out 
>> folder, rather than the root out folder).
>>
>> Cheers!
>>
>> -- 
>> -- 
>> 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 .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
-- 
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.
For more options, visit https://groups.google.com/d/optout.