gyp: libnode for ios app embedding

PR-URL: https://github.com/nodejs/node/pull/44210
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
This commit is contained in:
chexiongsheng 2022-09-21 18:02:40 +08:00 committed by GitHub
parent 68a3618bb4
commit 6c8c3d89b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 9 deletions

View File

@ -45,7 +45,7 @@ from utils import SearchFiles
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux', valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux',
'android', 'aix', 'cloudabi') 'android', 'aix', 'cloudabi', 'ios')
valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc', valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc',
'ppc64', 'x64', 'x86', 'x86_64', 's390x', 'riscv64', 'loong64') 'ppc64', 'x64', 'x86', 'x86_64', 's390x', 'riscv64', 'loong64')
valid_arm_float_abi = ('soft', 'softfp', 'hard') valid_arm_float_abi = ('soft', 'softfp', 'hard')
@ -2030,7 +2030,7 @@ gyp_args = ['--no-parallel', '-Dconfiguring_node=1']
gyp_args += ['-Dbuild_type=' + config['BUILDTYPE']] gyp_args += ['-Dbuild_type=' + config['BUILDTYPE']]
if options.use_ninja: if options.use_ninja:
gyp_args += ['-f', 'ninja'] gyp_args += ['-f', 'ninja-' + flavor]
elif flavor == 'win' and sys.platform != 'msys': elif flavor == 'win' and sys.platform != 'msys':
gyp_args += ['-f', 'msvs', '-G', 'msvs_version=auto'] gyp_args += ['-f', 'msvs', '-G', 'msvs_version=auto']
else: else:

View File

@ -157,7 +157,7 @@
'include_dirs': [ 'config/linux' ], 'include_dirs': [ 'config/linux' ],
'sources': [ 'config/linux/ares_config.h' ] 'sources': [ 'config/linux/ares_config.h' ]
}], }],
[ 'OS=="mac"', { [ 'OS=="mac" or OS=="ios"', {
'include_dirs': [ 'config/darwin' ], 'include_dirs': [ 'config/darwin' ],
'sources': [ 'config/darwin/ares_config.h' ] 'sources': [ 'config/darwin/ares_config.h' ]
}], }],

View File

@ -226,7 +226,7 @@
}, },
}, },
'conditions': [ 'conditions': [
['OS != "aix" and OS != "mac"', { ['OS != "aix" and OS != "mac" and OS != "ios"', {
'ldflags': [ 'ldflags': [
'-Wl,--whole-archive', '-Wl,--whole-archive',
'<(obj_dir)/<(STATIC_LIB_PREFIX)<(node_core_target_name)<(STATIC_LIB_SUFFIX)', '<(obj_dir)/<(STATIC_LIB_PREFIX)<(node_core_target_name)<(STATIC_LIB_SUFFIX)',

View File

@ -145,7 +145,7 @@
}, },
}, },
'conditions': [ 'conditions': [
['OS!="aix" and node_shared=="false"', { ['OS!="aix" and OS!="ios" and node_shared=="false"', {
'ldflags': [ 'ldflags': [
'-Wl,--whole-archive', '-Wl,--whole-archive',
'<(obj_dir)/deps/zlib/<(STATIC_LIB_PREFIX)zlib<(STATIC_LIB_SUFFIX)', '<(obj_dir)/deps/zlib/<(STATIC_LIB_PREFIX)zlib<(STATIC_LIB_SUFFIX)',
@ -184,7 +184,7 @@
}, },
}, },
'conditions': [ 'conditions': [
['OS!="aix" and node_shared=="false"', { ['OS!="aix" and OS!="ios" and node_shared=="false"', {
'ldflags': [ 'ldflags': [
'-Wl,--whole-archive', '-Wl,--whole-archive',
'<(obj_dir)/deps/uv/<(STATIC_LIB_PREFIX)uv<(STATIC_LIB_SUFFIX)', '<(obj_dir)/deps/uv/<(STATIC_LIB_PREFIX)uv<(STATIC_LIB_SUFFIX)',

View File

@ -847,7 +847,8 @@
'conditions': [ 'conditions': [
['v8_enable_webassembly==1', { ['v8_enable_webassembly==1', {
'conditions': [ 'conditions': [
['OS=="mac" or (_toolset=="host" and host_arch=="x64" and OS=="linux")', { ['OS=="mac" or OS=="ios" or '
'(_toolset=="host" and host_arch=="x64" and (host_os=="linux" or host_os=="mac"))', {
'sources': [ 'sources': [
'<(V8_ROOT)/src/trap-handler/handler-inside-posix.cc', '<(V8_ROOT)/src/trap-handler/handler-inside-posix.cc',
'<(V8_ROOT)/src/trap-handler/handler-outside-posix.cc', '<(V8_ROOT)/src/trap-handler/handler-outside-posix.cc',
@ -861,7 +862,8 @@
], ],
}], }],
# TODO(targos): Replace False with OS=="win" if handler-outside-simulator.cc becomes compatible with MSVC. # TODO(targos): Replace False with OS=="win" if handler-outside-simulator.cc becomes compatible with MSVC.
['_toolset=="host" and host_arch=="x64" and (OS=="linux" or OS=="mac" or False)', { ['_toolset=="host" and host_arch=="x64" and '
'(host_os=="linux" or host_os=="mac" or False)', {
'sources': [ 'sources': [
'<(V8_ROOT)/src/trap-handler/handler-outside-simulator.cc', '<(V8_ROOT)/src/trap-handler/handler-outside-simulator.cc',
], ],
@ -1145,13 +1147,19 @@
'<(V8_ROOT)/src/base/platform/platform-fuchsia.cc', '<(V8_ROOT)/src/base/platform/platform-fuchsia.cc',
] ]
}], }],
['OS == "mac" or OS == "ios"', { ['OS == "mac" or (_toolset=="host" and host_os=="mac")', {
'sources': [ 'sources': [
'<(V8_ROOT)/src/base/debug/stack_trace_posix.cc', '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
'<(V8_ROOT)/src/base/platform/platform-darwin.cc', '<(V8_ROOT)/src/base/platform/platform-darwin.cc',
'<(V8_ROOT)/src/base/platform/platform-macos.cc', '<(V8_ROOT)/src/base/platform/platform-macos.cc',
] ]
}], }],
['OS == "ios"', {
'sources': [
'<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
'<(V8_ROOT)/src/base/platform/platform-darwin.cc',
]
}],
['is_win', { ['is_win', {
'sources': [ 'sources': [
'<(V8_ROOT)/src/base/debug/stack_trace_win.cc', '<(V8_ROOT)/src/base/debug/stack_trace_win.cc',