Build node as shared library
This commit is contained in:
parent
ae9d90eaa6
commit
a400bb5997
5 changed files with 51 additions and 31 deletions
53
atom.gyp
53
atom.gyp
|
@ -120,9 +120,16 @@
|
||||||
'variables': {
|
'variables': {
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['libchromiumcontent_component', {
|
['libchromiumcontent_component', {
|
||||||
'copied_libraries': '<(libchromiumcontent_shared_libraries)',
|
'copied_libraries': [
|
||||||
|
'<(PRODUCT_DIR)/node.dll'
|
||||||
|
'<@(libchromiumcontent_shared_libraries)',
|
||||||
|
'<@(libchromiumcontent_shared_v8_libraries)',
|
||||||
|
],
|
||||||
}, {
|
}, {
|
||||||
'copied_libraries': ['<(libchromiumcontent_dir)/boringssl.dll'],
|
'copied_libraries': [
|
||||||
|
'<(PRODUCT_DIR)/node.dll'
|
||||||
|
'<(libchromiumcontent_dir)/boringssl.dll'
|
||||||
|
],
|
||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -159,9 +166,16 @@
|
||||||
'variables': {
|
'variables': {
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['libchromiumcontent_component', {
|
['libchromiumcontent_component', {
|
||||||
'copied_libraries': '<(libchromiumcontent_shared_libraries)',
|
'copied_libraries': [
|
||||||
|
'<(PRODUCT_DIR)/libnode.so'
|
||||||
|
'<@(libchromiumcontent_shared_libraries)',
|
||||||
|
'<@(libchromiumcontent_shared_v8_libraries)',
|
||||||
|
],
|
||||||
}, {
|
}, {
|
||||||
'copied_libraries': ['<(libchromiumcontent_dir)/libboringssl.so'],
|
'copied_libraries': [
|
||||||
|
'<(PRODUCT_DIR)/libnode.so'
|
||||||
|
'<(libchromiumcontent_dir)/libboringssl.so'
|
||||||
|
],
|
||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -192,7 +206,6 @@
|
||||||
'atom_coffee2c',
|
'atom_coffee2c',
|
||||||
'vendor/brightray/brightray.gyp:brightray',
|
'vendor/brightray/brightray.gyp:brightray',
|
||||||
'vendor/node/node.gyp:node',
|
'vendor/node/node.gyp:node',
|
||||||
'vendor/node/deps/openssl/openssl.gyp:openssl',
|
|
||||||
],
|
],
|
||||||
'defines': [
|
'defines': [
|
||||||
'PRODUCT_NAME="<(product_name)"',
|
'PRODUCT_NAME="<(product_name)"',
|
||||||
|
@ -221,11 +234,11 @@
|
||||||
'vendor/node/deps/http_parser',
|
'vendor/node/deps/http_parser',
|
||||||
'vendor/node/deps/uv/include',
|
'vendor/node/deps/uv/include',
|
||||||
# The `node.h` is using `#include"v8.h"`.
|
# The `node.h` is using `#include"v8.h"`.
|
||||||
'vendor/brightray/vendor/download/libchromiumcontent/src/v8/include',
|
'<(libchromiumcontent_src_dir)/v8/include',
|
||||||
# The `node.h` is using `#include"ares.h"`.
|
# The `node.h` is using `#include"ares.h"`.
|
||||||
'vendor/node/deps/cares/include',
|
'vendor/node/deps/cares/include',
|
||||||
# The `third_party/WebKit/Source/platform/weborigin/SchemeRegistry.h` is using `platform/PlatformExport.h`.
|
# The `third_party/WebKit/Source/platform/weborigin/SchemeRegistry.h` is using `platform/PlatformExport.h`.
|
||||||
'vendor/brightray/vendor/download/libchromiumcontent/src/third_party/WebKit/Source',
|
'<(libchromiumcontent_src_dir)/third_party/WebKit/Source',
|
||||||
],
|
],
|
||||||
'direct_dependent_settings': {
|
'direct_dependent_settings': {
|
||||||
'include_dirs': [
|
'include_dirs': [
|
||||||
|
@ -236,6 +249,11 @@
|
||||||
'vendor/brightray/brightray.gyp:brightray',
|
'vendor/brightray/brightray.gyp:brightray',
|
||||||
],
|
],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
|
['libchromiumcontent_component', {
|
||||||
|
'link_settings': {
|
||||||
|
'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
|
||||||
|
},
|
||||||
|
}],
|
||||||
['OS=="win"', {
|
['OS=="win"', {
|
||||||
'sources': [
|
'sources': [
|
||||||
'<@(lib_sources_win)',
|
'<@(lib_sources_win)',
|
||||||
|
@ -398,9 +416,16 @@
|
||||||
'variables': {
|
'variables': {
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['libchromiumcontent_component', {
|
['libchromiumcontent_component', {
|
||||||
'copied_libraries': '<(libchromiumcontent_shared_libraries)',
|
'copied_libraries': [
|
||||||
|
'<(PRODUCT_DIR)/libnode.dylib',
|
||||||
|
'<@(libchromiumcontent_shared_libraries)',
|
||||||
|
'<@(libchromiumcontent_shared_v8_libraries)',
|
||||||
|
],
|
||||||
}, {
|
}, {
|
||||||
'copied_libraries': ['<(libchromiumcontent_dir)/libboringssl.dylib'],
|
'copied_libraries': [
|
||||||
|
'<(PRODUCT_DIR)/libnode.dylib',
|
||||||
|
'<(libchromiumcontent_dir)/libboringssl.dylib'
|
||||||
|
],
|
||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -429,6 +454,16 @@
|
||||||
'${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework',
|
'${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'postbuild_name': 'Fix path of libnode',
|
||||||
|
'action': [
|
||||||
|
'install_name_tool',
|
||||||
|
'-change',
|
||||||
|
'/usr/local/lib/libnode.dylib',
|
||||||
|
'@rpath/libnode.dylib',
|
||||||
|
'${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework',
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'postbuild_name': 'Add symlinks for framework subdirectories',
|
'postbuild_name': 'Add symlinks for framework subdirectories',
|
||||||
'action': [
|
'action': [
|
||||||
|
|
23
common.gypi
23
common.gypi
|
@ -14,7 +14,7 @@
|
||||||
'node_shared_cares': 'false',
|
'node_shared_cares': 'false',
|
||||||
'node_shared_http_parser': 'false',
|
'node_shared_http_parser': 'false',
|
||||||
'node_shared_libuv': 'false',
|
'node_shared_libuv': 'false',
|
||||||
'node_shared_openssl': 'true',
|
'node_shared_openssl': 'false',
|
||||||
'node_shared_v8': 'true',
|
'node_shared_v8': 'true',
|
||||||
'node_shared_zlib': 'false',
|
'node_shared_zlib': 'false',
|
||||||
'node_tag': '',
|
'node_tag': '',
|
||||||
|
@ -92,30 +92,13 @@
|
||||||
'-Wno-unused-value',
|
'-Wno-unused-value',
|
||||||
'-Wno-deprecated-declarations',
|
'-Wno-deprecated-declarations',
|
||||||
'-Wno-return-type',
|
'-Wno-return-type',
|
||||||
# Fix relocation error when compiling as shared library.
|
|
||||||
'-fPIC',
|
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
['_target_name in ["node", "atom_lib"]', {
|
|
||||||
'include_dirs': [
|
|
||||||
'<(libchromiumcontent_src_dir)/v8/include',
|
|
||||||
'vendor/node/deps/openssl/openssl/include',
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
['_target_name=="node"', {
|
['_target_name=="node"', {
|
||||||
'conditions': [
|
'include_dirs': [ '<(libchromiumcontent_src_dir)/v8/include' ],
|
||||||
['OS=="mac"', {
|
'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
|
||||||
'libraries': [ '-undefined dynamic_lookup' ],
|
|
||||||
'xcode_settings': {
|
|
||||||
'DYLIB_INSTALL_NAME_BASE': '@rpath'
|
|
||||||
},
|
|
||||||
}],
|
|
||||||
['OS=="linux"', {
|
|
||||||
'cflags': [ '-fPIC' ],
|
|
||||||
}],
|
|
||||||
]
|
|
||||||
}],
|
}],
|
||||||
['_target_name=="libuv"', {
|
['_target_name=="libuv"', {
|
||||||
'conditions': [
|
'conditions': [
|
||||||
|
|
|
@ -33,6 +33,7 @@ TARGET_BINARIES = {
|
||||||
'icudtl.dat',
|
'icudtl.dat',
|
||||||
'libEGL.dll',
|
'libEGL.dll',
|
||||||
'libGLESv2.dll',
|
'libGLESv2.dll',
|
||||||
|
'node.dll',
|
||||||
'content_resources_200_percent.pak',
|
'content_resources_200_percent.pak',
|
||||||
'ui_resources_200_percent.pak',
|
'ui_resources_200_percent.pak',
|
||||||
'xinput1_3.dll',
|
'xinput1_3.dll',
|
||||||
|
@ -46,6 +47,7 @@ TARGET_BINARIES = {
|
||||||
'libboringssl.so',
|
'libboringssl.so',
|
||||||
'libffmpegsumo.so',
|
'libffmpegsumo.so',
|
||||||
'natives_blob.bin',
|
'natives_blob.bin',
|
||||||
|
'libnode.so',
|
||||||
'snapshot_blob.bin',
|
'snapshot_blob.bin',
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 21ab1efb09e8f7efa5591dc4c989f7012025a133
|
Subproject commit 1b62aab98e1e79f6357bd156fc2a43068d4a3f49
|
2
vendor/node
vendored
2
vendor/node
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit b1cd6a5f5e0b18e666c1a27794c4f77992a96bb7
|
Subproject commit bf5162b9042ff3e626a1adbd56b547801fda8cbf
|
Loading…
Add table
Reference in a new issue