2016-10-18 16:41:26 +02:00
|
|
|
{
|
2017-12-05 01:07:53 +01:00
|
|
|
# 'force_load' means to include the static libs into the shared lib or
|
|
|
|
# executable. Therefore, it is enabled when building:
|
|
|
|
# 1. The executable and it uses static lib (cctest and node)
|
|
|
|
# 2. The shared lib
|
|
|
|
# Linker optimizes out functions that are not used. When force_load=true,
|
|
|
|
# --whole-archive,force_load and /WHOLEARCHIVE are used to include
|
|
|
|
# all obj files in static libs into the executable or shared lib.
|
|
|
|
'variables': {
|
|
|
|
'variables': {
|
|
|
|
'variables': {
|
|
|
|
'force_load%': 'true',
|
|
|
|
'current_type%': '<(_type)',
|
|
|
|
},
|
|
|
|
'force_load%': '<(force_load)',
|
|
|
|
'conditions': [
|
|
|
|
['current_type=="static_library"', {
|
|
|
|
'force_load': 'false',
|
|
|
|
}],
|
|
|
|
[ 'current_type=="executable" and node_target_type=="shared_library"', {
|
|
|
|
'force_load': 'false',
|
|
|
|
}]
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'force_load%': '<(force_load)',
|
|
|
|
},
|
2018-09-30 19:44:55 +02:00
|
|
|
# Putting these explicitly here so not to be dependant on common.gypi.
|
|
|
|
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
|
|
|
|
'xcode_settings': {
|
|
|
|
'WARNING_CFLAGS': [
|
|
|
|
'-Wall',
|
|
|
|
'-Wendif-labels',
|
|
|
|
'-W',
|
|
|
|
'-Wno-unused-parameter',
|
2018-10-29 19:40:38 +01:00
|
|
|
'-Werror=undefined-inline',
|
2018-09-30 19:44:55 +02:00
|
|
|
],
|
|
|
|
},
|
2016-10-18 16:41:26 +02:00
|
|
|
'conditions': [
|
2018-10-29 19:40:38 +01:00
|
|
|
['clang==1', {
|
|
|
|
'cflags': [ '-Werror=undefined-inline', ]
|
|
|
|
}],
|
2016-10-18 16:41:26 +02:00
|
|
|
[ 'node_shared=="false"', {
|
|
|
|
'msvs_settings': {
|
|
|
|
'VCManifestTool': {
|
|
|
|
'EmbedManifest': 'true',
|
|
|
|
'AdditionalManifestFiles': 'src/res/node.exe.extra.manifest'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
'defines': [
|
|
|
|
'NODE_SHARED_MODE',
|
|
|
|
],
|
|
|
|
}],
|
2018-03-07 21:25:26 +01:00
|
|
|
[ 'OS=="win"', {
|
|
|
|
'defines!': [
|
|
|
|
'NODE_PLATFORM="win"',
|
|
|
|
],
|
|
|
|
'defines': [
|
|
|
|
'FD_SETSIZE=1024',
|
|
|
|
# we need to use node's preferred "win32" rather than gyp's preferred "win"
|
|
|
|
'NODE_PLATFORM="win32"',
|
|
|
|
# Stop <windows.h> from defining macros that conflict with
|
|
|
|
# std::min() and std::max(). We don't use <windows.h> (much)
|
|
|
|
# but we still inherit it from uv.h.
|
|
|
|
'NOMINMAX',
|
|
|
|
'_UNICODE=1',
|
|
|
|
],
|
|
|
|
}, { # POSIX
|
|
|
|
'defines': [ '__POSIX__' ],
|
|
|
|
}],
|
|
|
|
|
2016-10-18 16:41:26 +02:00
|
|
|
[ 'node_enable_d8=="true"', {
|
2018-01-26 03:35:26 +01:00
|
|
|
'dependencies': [ 'deps/v8/gypfiles/d8.gyp:d8' ],
|
2016-10-18 16:41:26 +02:00
|
|
|
}],
|
|
|
|
[ 'node_use_bundled_v8=="true"', {
|
2018-01-11 13:25:09 +01:00
|
|
|
'conditions': [
|
|
|
|
[ 'build_v8_with_gn=="true"', {
|
2018-02-09 17:39:58 +01:00
|
|
|
'dependencies': ['deps/v8/gypfiles/v8-monolithic.gyp:v8_monolith'],
|
2018-01-11 13:25:09 +01:00
|
|
|
}, {
|
|
|
|
'dependencies': [
|
|
|
|
'deps/v8/gypfiles/v8.gyp:v8',
|
|
|
|
'deps/v8/gypfiles/v8.gyp:v8_libplatform',
|
|
|
|
],
|
|
|
|
}],
|
2016-10-18 16:41:26 +02:00
|
|
|
],
|
|
|
|
}],
|
|
|
|
[ 'node_use_v8_platform=="true"', {
|
|
|
|
'defines': [
|
|
|
|
'NODE_USE_V8_PLATFORM=1',
|
|
|
|
],
|
|
|
|
}, {
|
|
|
|
'defines': [
|
|
|
|
'NODE_USE_V8_PLATFORM=0',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
[ 'node_tag!=""', {
|
|
|
|
'defines': [ 'NODE_TAG="<(node_tag)"' ],
|
|
|
|
}],
|
|
|
|
[ 'node_v8_options!=""', {
|
|
|
|
'defines': [ 'NODE_V8_OPTIONS="<(node_v8_options)"'],
|
|
|
|
}],
|
|
|
|
[ 'node_release_urlbase!=""', {
|
|
|
|
'defines': [
|
|
|
|
'NODE_RELEASE_URLBASE="<(node_release_urlbase)"',
|
|
|
|
]
|
|
|
|
}],
|
|
|
|
[ 'v8_enable_i18n_support==1', {
|
|
|
|
'defines': [ 'NODE_HAVE_I18N_SUPPORT=1' ],
|
|
|
|
'dependencies': [
|
|
|
|
'<(icu_gyp_path):icui18n',
|
|
|
|
'<(icu_gyp_path):icuuc',
|
|
|
|
],
|
|
|
|
'conditions': [
|
|
|
|
[ 'icu_small=="true"', {
|
|
|
|
'defines': [ 'NODE_HAVE_SMALL_ICU=1' ],
|
|
|
|
}]],
|
|
|
|
}],
|
|
|
|
[ 'node_use_bundled_v8=="true" and \
|
|
|
|
node_enable_v8_vtunejit=="true" and (target_arch=="x64" or \
|
|
|
|
target_arch=="ia32" or target_arch=="x32")', {
|
|
|
|
'defines': [ 'NODE_ENABLE_VTUNE_PROFILING' ],
|
|
|
|
'dependencies': [
|
2018-01-26 03:35:26 +01:00
|
|
|
'deps/v8/gypfiles/v8vtune.gyp:v8_vtune'
|
2016-10-18 16:41:26 +02:00
|
|
|
],
|
|
|
|
}],
|
|
|
|
[ 'node_no_browser_globals=="true"', {
|
|
|
|
'defines': [ 'NODE_NO_BROWSER_GLOBALS' ],
|
|
|
|
} ],
|
2018-09-30 19:39:54 +02:00
|
|
|
[ 'node_use_bundled_v8=="true" and v8_postmortem_support=="true" and force_load=="true"', {
|
|
|
|
'xcode_settings': {
|
|
|
|
'OTHER_LDFLAGS': [
|
|
|
|
'-Wl,-force_load,<(v8_base)',
|
|
|
|
],
|
|
|
|
},
|
2016-10-18 16:41:26 +02:00
|
|
|
}],
|
|
|
|
[ 'node_shared_zlib=="false"', {
|
|
|
|
'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ],
|
2018-01-17 22:16:14 +01:00
|
|
|
'conditions': [
|
|
|
|
[ 'force_load=="true"', {
|
|
|
|
'xcode_settings': {
|
|
|
|
'OTHER_LDFLAGS': [
|
|
|
|
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)'
|
|
|
|
'zlib<(STATIC_LIB_SUFFIX)',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'msvs_settings': {
|
|
|
|
'VCLinkerTool': {
|
|
|
|
'AdditionalOptions': [
|
2018-09-04 03:56:02 +02:00
|
|
|
'/WHOLEARCHIVE:zlib<(STATIC_LIB_SUFFIX)',
|
2018-01-17 22:16:14 +01:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'conditions': [
|
|
|
|
['OS!="aix" and node_shared=="false"', {
|
|
|
|
'ldflags': [
|
|
|
|
'-Wl,--whole-archive,<(obj_dir)/deps/zlib/<(STATIC_LIB_PREFIX)'
|
|
|
|
'zlib<(STATIC_LIB_SUFFIX)',
|
|
|
|
'-Wl,--no-whole-archive',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
2016-10-18 16:41:26 +02:00
|
|
|
}],
|
|
|
|
|
2018-10-30 03:06:09 +01:00
|
|
|
[ 'node_experimental_http_parser=="true"', {
|
|
|
|
'defines': [ 'NODE_EXPERIMENTAL_HTTP' ],
|
|
|
|
'dependencies': [ 'deps/llhttp/llhttp.gyp:llhttp' ],
|
|
|
|
}, {
|
|
|
|
'conditions': [ [ 'node_shared_http_parser=="false"', {
|
|
|
|
'dependencies': [ 'deps/http_parser/http_parser.gyp:http_parser' ],
|
|
|
|
} ] ],
|
|
|
|
} ],
|
2016-10-18 16:41:26 +02:00
|
|
|
|
|
|
|
[ 'node_shared_cares=="false"', {
|
|
|
|
'dependencies': [ 'deps/cares/cares.gyp:cares' ],
|
|
|
|
}],
|
|
|
|
|
|
|
|
[ 'node_shared_libuv=="false"', {
|
|
|
|
'dependencies': [ 'deps/uv/uv.gyp:libuv' ],
|
2018-01-17 22:16:14 +01:00
|
|
|
'conditions': [
|
|
|
|
[ 'force_load=="true"', {
|
|
|
|
'xcode_settings': {
|
|
|
|
'OTHER_LDFLAGS': [
|
|
|
|
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)'
|
|
|
|
'uv<(STATIC_LIB_SUFFIX)',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'msvs_settings': {
|
|
|
|
'VCLinkerTool': {
|
|
|
|
'AdditionalOptions': [
|
2018-09-04 03:56:02 +02:00
|
|
|
'/WHOLEARCHIVE:libuv<(STATIC_LIB_SUFFIX)',
|
2018-01-17 22:16:14 +01:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'conditions': [
|
|
|
|
['OS!="aix" and node_shared=="false"', {
|
|
|
|
'ldflags': [
|
|
|
|
'-Wl,--whole-archive,<(obj_dir)/deps/uv/<(STATIC_LIB_PREFIX)'
|
|
|
|
'uv<(STATIC_LIB_SUFFIX)',
|
|
|
|
'-Wl,--no-whole-archive',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
2016-10-18 16:41:26 +02:00
|
|
|
}],
|
|
|
|
|
2017-11-06 09:59:01 +01:00
|
|
|
[ 'node_shared_nghttp2=="false"', {
|
|
|
|
'dependencies': [ 'deps/nghttp2/nghttp2.gyp:nghttp2' ],
|
|
|
|
}],
|
|
|
|
|
2016-10-18 16:41:26 +02:00
|
|
|
[ 'OS=="mac"', {
|
|
|
|
# linking Corefoundation is needed since certain OSX debugging tools
|
|
|
|
# like Instruments require it for some features
|
|
|
|
'libraries': [ '-framework CoreFoundation' ],
|
|
|
|
'defines!': [
|
|
|
|
'NODE_PLATFORM="mac"',
|
|
|
|
],
|
|
|
|
'defines': [
|
|
|
|
# we need to use node's preferred "darwin" rather than gyp's preferred "mac"
|
|
|
|
'NODE_PLATFORM="darwin"',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
[ 'OS=="freebsd"', {
|
|
|
|
'libraries': [
|
|
|
|
'-lutil',
|
|
|
|
'-lkvm',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
[ 'OS=="aix"', {
|
|
|
|
'defines': [
|
|
|
|
'_LINUX_SOURCE_COMPAT',
|
|
|
|
],
|
2017-12-05 01:07:53 +01:00
|
|
|
'conditions': [
|
|
|
|
[ 'force_load=="true"', {
|
|
|
|
|
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'expfile',
|
|
|
|
'inputs': [
|
2017-10-16 15:34:42 +02:00
|
|
|
'<(obj_dir)'
|
2017-12-05 01:07:53 +01:00
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(PRODUCT_DIR)/node.exp'
|
|
|
|
],
|
|
|
|
'action': [
|
|
|
|
'sh', 'tools/create_expfile.sh',
|
|
|
|
'<@(_inputs)', '<@(_outputs)'
|
|
|
|
],
|
|
|
|
}
|
|
|
|
],
|
|
|
|
'ldflags': ['-Wl,-bE:<(PRODUCT_DIR)/node.exp', '-Wl,-brtl'],
|
|
|
|
}],
|
|
|
|
],
|
2016-10-18 16:41:26 +02:00
|
|
|
}],
|
|
|
|
[ 'OS=="solaris"', {
|
|
|
|
'libraries': [
|
|
|
|
'-lkstat',
|
|
|
|
'-lumem',
|
|
|
|
],
|
|
|
|
'defines!': [
|
|
|
|
'NODE_PLATFORM="solaris"',
|
|
|
|
],
|
|
|
|
'defines': [
|
|
|
|
# we need to use node's preferred "sunos"
|
|
|
|
# rather than gyp's preferred "solaris"
|
|
|
|
'NODE_PLATFORM="sunos"',
|
|
|
|
],
|
|
|
|
}],
|
2017-12-05 01:07:53 +01:00
|
|
|
[ '(OS=="freebsd" or OS=="linux") and node_shared=="false"'
|
2018-01-27 07:35:35 +01:00
|
|
|
' and force_load=="true"', {
|
2016-10-18 16:41:26 +02:00
|
|
|
'ldflags': [ '-Wl,-z,noexecstack',
|
2017-10-16 15:34:42 +02:00
|
|
|
'-Wl,--whole-archive <(v8_base)',
|
2016-10-18 16:41:26 +02:00
|
|
|
'-Wl,--no-whole-archive' ]
|
|
|
|
}],
|
2018-11-20 17:26:48 +01:00
|
|
|
[ 'coverage=="true" and node_shared=="false" and OS in "mac freebsd linux"', {
|
|
|
|
'cflags!': [ '-O3' ],
|
2018-01-27 07:35:35 +01:00
|
|
|
'ldflags': [ '--coverage',
|
2016-10-18 16:41:26 +02:00
|
|
|
'-g',
|
|
|
|
'-O0' ],
|
2018-01-27 07:35:35 +01:00
|
|
|
'cflags': [ '--coverage',
|
2016-10-18 16:41:26 +02:00
|
|
|
'-g',
|
2017-04-13 22:31:44 +02:00
|
|
|
'-O0' ],
|
2017-10-09 20:30:38 +02:00
|
|
|
'xcode_settings': {
|
2018-11-20 17:26:48 +01:00
|
|
|
'OTHER_CFLAGS': [
|
2017-10-09 20:30:38 +02:00
|
|
|
'--coverage',
|
|
|
|
'-g',
|
|
|
|
'-O0'
|
|
|
|
],
|
2018-11-20 17:26:48 +01:00
|
|
|
},
|
|
|
|
'conditions': [
|
|
|
|
[ '_type=="executable"', {
|
|
|
|
'xcode_settings': {
|
|
|
|
'OTHER_LDFLAGS': [ '--coverage', ],
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
],
|
2017-10-09 20:30:38 +02:00
|
|
|
}],
|
2016-10-18 16:41:26 +02:00
|
|
|
[ 'OS=="sunos"', {
|
|
|
|
'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ],
|
|
|
|
}],
|
2018-05-03 10:51:56 +02:00
|
|
|
[ 'OS in "freebsd linux"', {
|
|
|
|
'ldflags': [ '-Wl,-z,relro',
|
|
|
|
'-Wl,-z,now' ]
|
|
|
|
}],
|
2018-03-23 20:16:48 +01:00
|
|
|
[ 'OS=="linux" and target_arch=="x64" and node_use_large_pages=="true"', {
|
|
|
|
'ldflags': [
|
|
|
|
'-Wl,-T',
|
|
|
|
'<!(realpath src/large_pages/ld.implicit.script)',
|
|
|
|
]
|
|
|
|
}],
|
2017-12-05 01:07:53 +01:00
|
|
|
[ 'node_use_openssl=="true"', {
|
|
|
|
'defines': [ 'HAVE_OPENSSL=1' ],
|
|
|
|
'conditions': [
|
|
|
|
['openssl_fips != ""', {
|
|
|
|
'defines': [ 'NODE_FIPS_MODE' ],
|
|
|
|
}],
|
|
|
|
[ 'node_shared_openssl=="false"', {
|
|
|
|
'dependencies': [
|
|
|
|
'./deps/openssl/openssl.gyp:openssl',
|
|
|
|
|
|
|
|
# For tests
|
|
|
|
'./deps/openssl/openssl.gyp:openssl-cli',
|
|
|
|
],
|
|
|
|
'conditions': [
|
|
|
|
# -force_load or --whole-archive are not applicable for
|
|
|
|
# the static library
|
|
|
|
[ 'force_load=="true"', {
|
|
|
|
'xcode_settings': {
|
|
|
|
'OTHER_LDFLAGS': [
|
2017-10-16 15:34:42 +02:00
|
|
|
'-Wl,-force_load,<(PRODUCT_DIR)/<(openssl_product)',
|
2017-12-05 01:07:53 +01:00
|
|
|
],
|
|
|
|
},
|
2018-01-17 22:16:14 +01:00
|
|
|
'msvs_settings': {
|
|
|
|
'VCLinkerTool': {
|
|
|
|
'AdditionalOptions': [
|
2018-09-04 03:56:02 +02:00
|
|
|
'/WHOLEARCHIVE:<(openssl_product)',
|
2018-01-17 22:16:14 +01:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2017-12-05 01:07:53 +01:00
|
|
|
'conditions': [
|
|
|
|
['OS in "linux freebsd" and node_shared=="false"', {
|
|
|
|
'ldflags': [
|
|
|
|
'-Wl,--whole-archive,'
|
2018-01-17 22:16:14 +01:00
|
|
|
'<(obj_dir)/deps/openssl/<(openssl_product)',
|
2017-12-05 01:07:53 +01:00
|
|
|
'-Wl,--no-whole-archive',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
# openssl.def is based on zlib.def, zlib symbols
|
|
|
|
# are always exported.
|
|
|
|
['use_openssl_def==1', {
|
|
|
|
'sources': ['<(SHARED_INTERMEDIATE_DIR)/openssl.def'],
|
|
|
|
}],
|
|
|
|
['OS=="win" and use_openssl_def==0', {
|
|
|
|
'sources': ['deps/zlib/win32/zlib.def'],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
}]]
|
|
|
|
|
|
|
|
}, {
|
|
|
|
'defines': [ 'HAVE_OPENSSL=0' ]
|
|
|
|
}],
|
|
|
|
|
2016-10-18 16:41:26 +02:00
|
|
|
],
|
|
|
|
}
|