mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Build node as shared library
This commit is contained in:
53
atom.gyp
53
atom.gyp
@@ -120,9 +120,16 @@
|
||||
'variables': {
|
||||
'conditions': [
|
||||
['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': {
|
||||
'conditions': [
|
||||
['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',
|
||||
'vendor/brightray/brightray.gyp:brightray',
|
||||
'vendor/node/node.gyp:node',
|
||||
'vendor/node/deps/openssl/openssl.gyp:openssl',
|
||||
],
|
||||
'defines': [
|
||||
'PRODUCT_NAME="<(product_name)"',
|
||||
@@ -221,11 +234,11 @@
|
||||
'vendor/node/deps/http_parser',
|
||||
'vendor/node/deps/uv/include',
|
||||
# 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"`.
|
||||
'vendor/node/deps/cares/include',
|
||||
# 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': {
|
||||
'include_dirs': [
|
||||
@@ -236,6 +249,11 @@
|
||||
'vendor/brightray/brightray.gyp:brightray',
|
||||
],
|
||||
'conditions': [
|
||||
['libchromiumcontent_component', {
|
||||
'link_settings': {
|
||||
'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
|
||||
},
|
||||
}],
|
||||
['OS=="win"', {
|
||||
'sources': [
|
||||
'<@(lib_sources_win)',
|
||||
@@ -398,9 +416,16 @@
|
||||
'variables': {
|
||||
'conditions': [
|
||||
['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',
|
||||
],
|
||||
},
|
||||
{
|
||||
'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',
|
||||
'action': [
|
||||
|
||||
23
common.gypi
23
common.gypi
@@ -14,7 +14,7 @@
|
||||
'node_shared_cares': 'false',
|
||||
'node_shared_http_parser': 'false',
|
||||
'node_shared_libuv': 'false',
|
||||
'node_shared_openssl': 'true',
|
||||
'node_shared_openssl': 'false',
|
||||
'node_shared_v8': 'true',
|
||||
'node_shared_zlib': 'false',
|
||||
'node_tag': '',
|
||||
@@ -92,30 +92,13 @@
|
||||
'-Wno-unused-value',
|
||||
'-Wno-deprecated-declarations',
|
||||
'-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"', {
|
||||
'conditions': [
|
||||
['OS=="mac"', {
|
||||
'libraries': [ '-undefined dynamic_lookup' ],
|
||||
'xcode_settings': {
|
||||
'DYLIB_INSTALL_NAME_BASE': '@rpath'
|
||||
},
|
||||
}],
|
||||
['OS=="linux"', {
|
||||
'cflags': [ '-fPIC' ],
|
||||
}],
|
||||
]
|
||||
'include_dirs': [ '<(libchromiumcontent_src_dir)/v8/include' ],
|
||||
'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
|
||||
}],
|
||||
['_target_name=="libuv"', {
|
||||
'conditions': [
|
||||
|
||||
@@ -33,6 +33,7 @@ TARGET_BINARIES = {
|
||||
'icudtl.dat',
|
||||
'libEGL.dll',
|
||||
'libGLESv2.dll',
|
||||
'node.dll',
|
||||
'content_resources_200_percent.pak',
|
||||
'ui_resources_200_percent.pak',
|
||||
'xinput1_3.dll',
|
||||
@@ -46,6 +47,7 @@ TARGET_BINARIES = {
|
||||
'libboringssl.so',
|
||||
'libffmpegsumo.so',
|
||||
'natives_blob.bin',
|
||||
'libnode.so',
|
||||
'snapshot_blob.bin',
|
||||
],
|
||||
}
|
||||
|
||||
2
vendor/brightray
vendored
2
vendor/brightray
vendored
Submodule vendor/brightray updated: 21ab1efb09...1b62aab98e
2
vendor/node
vendored
2
vendor/node
vendored
Submodule vendor/node updated: b1cd6a5f5e...bf5162b904
Reference in New Issue
Block a user