]> khamidou — GitHub mirrors - electron.git/commitdiff
Build node as shared library
authorCheng Zhao <zcbenz@gmail.com>
Wed, 1 Apr 2015 12:26:46 +0000 (20:26 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 1 Apr 2015 12:26:46 +0000 (20:26 +0800)
atom.gyp
common.gypi
script/update.py
vendor/node

index 7b77e6408cb461724a2538653d8033bd1a394f68..86b95e3978d13daf426475a67ed35a8291ee2f7e 100644 (file)
--- a/atom.gyp
+++ b/atom.gyp
                 '<(libchromiumcontent_resources_dir)/ui_resources_200_percent.pak',
                 '<(libchromiumcontent_resources_dir)/natives_blob.bin',
                 '<(libchromiumcontent_resources_dir)/snapshot_blob.bin',
+                '<(PRODUCT_DIR)/node.dll',
                 'external_binaries/d3dcompiler_47.dll',
                 'external_binaries/msvcp120.dll',
                 'external_binaries/msvcr120.dll',
                 '<(libchromiumcontent_resources_dir)/content_shell.pak',
                 '<(libchromiumcontent_resources_dir)/natives_blob.bin',
                 '<(libchromiumcontent_resources_dir)/snapshot_blob.bin',
+                '<(PRODUCT_DIR)/libnode.so',
               ],
             },
             {
       'dependencies': [
         'atom_coffee2c',
         'vendor/brightray/brightray.gyp:brightray',
-        'vendor/node/node.gyp:node_lib',
+        'vendor/node/node.gyp:node',
       ],
       'defines': [
         'PRODUCT_NAME="<(product_name)"',
           ],
           'xcode_settings': {
             'INFOPLIST_FILE': 'atom/common/resources/mac/Info.plist',
-            'LIBRARY_SEARCH_PATHS': [
-              '<(libchromiumcontent_library_dir)',
-            ],
             'LD_DYLIB_INSTALL_NAME': '@rpath/<(product_name) Framework.framework/<(product_name) Framework',
             'LD_RUNPATH_SEARCH_PATHS': [
               '@loader_path/Libraries',
               'files': [
                 '<(libchromiumcontent_library_dir)/ffmpegsumo.so',
                 '<(libchromiumcontent_library_dir)/libchromiumcontent.dylib',
+                '<(PRODUCT_DIR)/libnode.dylib',
               ],
             },
             {
             },
           ],
           'postbuilds': [
+            {
+              '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': [
index fae82aaf21115bd279649700f35d8cd153e61836..17e9fd9ff0782a73dbad083b208386ebcff48846 100644 (file)
@@ -1,4 +1,7 @@
 {
+  'includes': [
+    'vendor/brightray/brightray.gypi',
+  ],
   'variables': {
     'clang': 0,
     'openssl_no_asm': 1,
@@ -37,7 +40,7 @@
   # Settings to compile node under Windows.
   'target_defaults': {
     'target_conditions': [
-      ['_target_name in ["libuv", "http_parser", "cares", "openssl", "openssl-cli", "node_lib", "zlib"]', {
+      ['_target_name in ["libuv", "http_parser", "cares", "openssl", "openssl-cli", "node", "zlib"]', {
         'msvs_disabled_warnings': [
           4703,  # potentially uninitialized local pointer variable 'req' used
           4013,  # 'free' undefined; assuming extern returning int
           }],
         ],
       }],
-      ['_target_name in ["node_lib", "atom_lib"]', {
+      ['_target_name in ["node", "atom_lib"]', {
         'include_dirs': [
           'vendor/brightray/vendor/download/libchromiumcontent/src/v8/include',
         ],
       }],
+      ['_target_name=="node"', {
+        'conditions': [
+          ['OS=="linux"', {
+            'libraries': [
+              '<(libchromiumcontent_library_dir)/libchromiumcontent.so',
+            ],
+          }],
+          ['OS=="win"', {
+            'libraries': [
+              '<(libchromiumcontent_library_dir)/chromiumcontent.dll.lib',
+            ],
+          }],
+          ['OS=="mac"', {
+            'libraries': [
+              '<(libchromiumcontent_library_dir)/libchromiumcontent.dylib',
+            ],
+          }],
+        ],
+      }],
       ['_target_name=="libuv"', {
         'conditions': [
           ['OS=="win"', {
index 61eb4088be5d84d10ba91bb9e4737e36cc5cc0e0..2fe52e7f3a6145e569fd7599be01be4a35b34f75 100755 (executable)
@@ -38,7 +38,7 @@ def update_gyp():
 
   ret = subprocess.call([python, gyp,
                          '-f', 'ninja', '--depth', '.', 'atom.gyp',
-                         '-Icommon.gypi', '-Ivendor/brightray/brightray.gypi',
+                         '-Icommon.gypi',
                          '-Dlinux_clang=0',  # Disable brightray's clang setting
                          '-Dtarget_arch={0}'.format(arch),
                          '-Dlibrary=static_library'])
index 6479eb98d5b3d9d25a86eff857af17dcc61f3bc4..ea394ef8974a06918af0c6f104a07bff3f4e627f 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 6479eb98d5b3d9d25a86eff857af17dcc61f3bc4
+Subproject commit ea394ef8974a06918af0c6f104a07bff3f4e627f