Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
build: support shared V8 properly
Browse files Browse the repository at this point in the history
-don't pull in bundled v8 as a dependency when node_shared_v8==true
-use node_shared_v8_includes for v8.h and v8-debug.h
  • Loading branch information
tchollingsworth authored and bnoordhuis committed Feb 22, 2012
1 parent 21374c3 commit 3d1b670
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions configure
Expand Up @@ -208,8 +208,11 @@ def configure_v8(o):
o['libraries'] += ['-L%s' % options.shared_v8_libpath]
if options.shared_v8_libname:
o['libraries'] += ['-l%s' % options.shared_v8_libname]
elif options.shared_v8:
o['libraries'] += ['-lv8']
if options.shared_v8_includes:
o['include_dirs'] += [options.shared_v8_includes]
o['variables']['node_shared_v8_includes'] = options.shared_v8_includes


def configure_cares(o):
Expand Down
18 changes: 15 additions & 3 deletions node.gyp
Expand Up @@ -54,7 +54,6 @@

'dependencies': [
'deps/http_parser/http_parser.gyp:http_parser',
'deps/v8/tools/gyp/v8.gyp:v8',
'deps/uv/uv.gyp:uv',
'deps/zlib/zlib.gyp:zlib',
'node_js2c#host',
Expand Down Expand Up @@ -110,8 +109,6 @@
'src/stream_wrap.h',
'src/v8_typed_array.h',
'deps/http_parser/http_parser.h',
'deps/v8/include/v8.h',
'deps/v8/include/v8-debug.h',
'<(SHARED_INTERMEDIATE_DIR)/node_natives.h',
# javascript files to make for an even more pleasant IDE experience
'<@(library_files)',
Expand Down Expand Up @@ -147,6 +144,21 @@
],
}],

[ 'node_shared_v8=="true"', {
'sources': [
'<(node_shared_v8_includes)/v8.h',
'<(node_shared_v8_includes)/v8-debug.h',
],
}],

[ 'node_shared_v8=="false"', {

This comment has been minimized.

Copy link
@bnoordhuis

bnoordhuis Feb 24, 2012

Member

@tchollingsworth: Presumably the below will work better:

[ 'node_shared_v8=="true"', {
  'sources': [
    '<(node_shared_v8_includes)/v8.h',
    '<(node_shared_v8_includes)/v8-debug.h',
  ],
}, {
  'sources': [
    'deps/v8/include/v8.h',
    'deps/v8/include/v8-debug.h',
  ],
  'dependencies': [ 'deps/v8/tools/gyp/v8.gyp:v8' ],
}]

This comment has been minimized.

Copy link
@tchollingsworth

tchollingsworth Feb 24, 2012

Author

Cool, I figured there had to be a way to do else but it's conspicuously missing from the gyp wiki. :-(

#2825

'sources': [
'deps/v8/include/v8.h',
'deps/v8/include/v8-debug.h',
],
'dependencies': [ 'deps/v8/tools/gyp/v8.gyp:v8' ],
}],

[ 'OS=="win"', {
'sources': [
'tools/msvs/res/node.rc',
Expand Down

2 comments on commit 3d1b670

@kapouer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hell yeah !

@isaacs
Copy link

@isaacs isaacs commented on 3d1b670 Feb 23, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the build on Windows. Probably an easy patch to have vcbuild.bat set this. Reverting for v0.7.5 build. https://gist.github.com/1895279

Please sign in to comment.