2016-10-18 14:41:26 +00:00
|
|
|
{
|
2017-12-05 00:07:53 +00: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 17:44:55 +00: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 18:40:38 +00:00
|
|
|
'-Werror=undefined-inline',
|
2018-09-30 17:44:55 +00:00
|
|
|
],
|
|
|
|
},
|
2019-02-02 03:03:47 +00:00
|
|
|
# Relevant only for x86.
|
|
|
|
# Refs: https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
|
|
|
|
'msvs_settings': {
|
|
|
|
'VCLinkerTool': {
|
|
|
|
'ImageHasSafeExceptionHandlers': 'false',
|
|
|
|
},
|
|
|
|
},
|
2016-10-18 14:41:26 +00:00
|
|
|
'conditions': [
|
2018-10-13 19:13:43 +00:00
|
|
|
[ 'clang==1', {
|
2018-10-29 18:40:38 +00:00
|
|
|
'cflags': [ '-Werror=undefined-inline', ]
|
|
|
|
}],
|
2016-10-18 14:41:26 +00:00
|
|
|
[ 'node_shared=="false"', {
|
|
|
|
'msvs_settings': {
|
|
|
|
'VCManifestTool': {
|
|
|
|
'EmbedManifest': 'true',
|
|
|
|
'AdditionalManifestFiles': 'src/res/node.exe.extra.manifest'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
'defines': [
|
|
|
|
'NODE_SHARED_MODE',
|
|
|
|
],
|
|
|
|
}],
|
2018-03-07 20:25:26 +00: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',
|
|
|
|
],
|
2018-10-13 19:13:43 +00:00
|
|
|
'msvs_precompiled_header': 'tools/msvs/pch/node_pch.h',
|
|
|
|
'msvs_precompiled_source': 'tools/msvs/pch/node_pch.cc',
|
|
|
|
'sources': [
|
|
|
|
'<(_msvs_precompiled_header)',
|
|
|
|
'<(_msvs_precompiled_source)',
|
|
|
|
],
|
2019-02-04 20:49:47 +00:00
|
|
|
}, { # POSIX
|
|
|
|
'defines': [ '__POSIX__' ],
|
2018-10-13 19:13:43 +00:00
|
|
|
}],
|
2016-10-18 14:41:26 +00:00
|
|
|
[ 'node_enable_d8=="true"', {
|
2018-01-26 02:35:26 +00:00
|
|
|
'dependencies': [ 'deps/v8/gypfiles/d8.gyp:d8' ],
|
2016-10-18 14:41:26 +00:00
|
|
|
}],
|
|
|
|
[ 'node_use_bundled_v8=="true"', {
|
2019-03-25 02:58:29 +00:00
|
|
|
'dependencies': [
|
|
|
|
'tools/v8_gypfiles/v8.gyp:v8',
|
|
|
|
'tools/v8_gypfiles/v8.gyp:v8_libplatform',
|
2016-10-18 14:41:26 +00: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': [
|
2019-03-25 02:58:29 +00:00
|
|
|
'tools/v8_gypfiles/v8vtune.gyp:v8_vtune'
|
2016-10-18 14:41:26 +00:00
|
|
|
],
|
|
|
|
}],
|
|
|
|
[ 'node_no_browser_globals=="true"', {
|
|
|
|
'defines': [ 'NODE_NO_BROWSER_GLOBALS' ],
|
|
|
|
} ],
|
2019-01-25 19:03:36 +00:00
|
|
|
[ 'node_use_bundled_v8=="true" and v8_postmortem_support==1 and force_load=="true"', {
|
2018-09-30 17:39:54 +00:00
|
|
|
'xcode_settings': {
|
|
|
|
'OTHER_LDFLAGS': [
|
|
|
|
'-Wl,-force_load,<(v8_base)',
|
|
|
|
],
|
|
|
|
},
|
2016-10-18 14:41:26 +00:00
|
|
|
}],
|
|
|
|
[ 'node_shared_zlib=="false"', {
|
|
|
|
'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ],
|
2018-01-17 21:16:14 +00: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 01:56:02 +00:00
|
|
|
'/WHOLEARCHIVE:zlib<(STATIC_LIB_SUFFIX)',
|
2018-01-17 21:16:14 +00: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 14:41:26 +00:00
|
|
|
}],
|
|
|
|
|
2018-11-30 06:39:02 +00:00
|
|
|
[ 'node_shared_http_parser=="false"', {
|
|
|
|
'dependencies': [
|
|
|
|
'deps/http_parser/http_parser.gyp:http_parser',
|
|
|
|
'deps/llhttp/llhttp.gyp:llhttp'
|
|
|
|
],
|
2018-10-30 02:06:09 +00:00
|
|
|
} ],
|
2016-10-18 14:41:26 +00:00
|
|
|
|
|
|
|
[ 'node_shared_cares=="false"', {
|
|
|
|
'dependencies': [ 'deps/cares/cares.gyp:cares' ],
|
|
|
|
}],
|
|
|
|
|
|
|
|
[ 'node_shared_libuv=="false"', {
|
|
|
|
'dependencies': [ 'deps/uv/uv.gyp:libuv' ],
|
2018-01-17 21:16:14 +00: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 01:56:02 +00:00
|
|
|
'/WHOLEARCHIVE:libuv<(STATIC_LIB_SUFFIX)',
|
2018-01-17 21:16:14 +00: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 14:41:26 +00:00
|
|
|
}],
|
|
|
|
|
2017-11-06 08:59:01 +00:00
|
|
|
[ 'node_shared_nghttp2=="false"', {
|
|
|
|
'dependencies': [ 'deps/nghttp2/nghttp2.gyp:nghttp2' ],
|
|
|
|
}],
|
|
|
|
|
2018-11-27 01:16:34 +00:00
|
|
|
[ 'node_shared_brotli=="false"', {
|
|
|
|
'dependencies': [ 'deps/brotli/brotli.gyp:brotli' ],
|
|
|
|
}],
|
|
|
|
|
2016-10-18 14:41:26 +00: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',
|
2019-01-07 19:36:35 +00:00
|
|
|
'__STDC_FORMAT_MACROS'
|
2016-10-18 14:41:26 +00:00
|
|
|
],
|
2017-12-05 00:07:53 +00:00
|
|
|
'conditions': [
|
|
|
|
[ 'force_load=="true"', {
|
|
|
|
|
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'expfile',
|
|
|
|
'inputs': [
|
2017-10-16 13:34:42 +00:00
|
|
|
'<(obj_dir)'
|
2017-12-05 00:07:53 +00: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 14:41:26 +00: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 00:07:53 +00:00
|
|
|
[ '(OS=="freebsd" or OS=="linux") and node_shared=="false"'
|
2018-01-27 06:35:35 +00:00
|
|
|
' and force_load=="true"', {
|
2016-10-18 14:41:26 +00:00
|
|
|
'ldflags': [ '-Wl,-z,noexecstack',
|
2017-10-16 13:34:42 +00:00
|
|
|
'-Wl,--whole-archive <(v8_base)',
|
2016-10-18 14:41:26 +00:00
|
|
|
'-Wl,--no-whole-archive' ]
|
|
|
|
}],
|
2018-11-20 16:26:48 +00:00
|
|
|
[ 'coverage=="true" and node_shared=="false" and OS in "mac freebsd linux"', {
|
|
|
|
'cflags!': [ '-O3' ],
|
2018-01-27 06:35:35 +00:00
|
|
|
'ldflags': [ '--coverage',
|
2016-10-18 14:41:26 +00:00
|
|
|
'-g',
|
|
|
|
'-O0' ],
|
2018-01-27 06:35:35 +00:00
|
|
|
'cflags': [ '--coverage',
|
2016-10-18 14:41:26 +00:00
|
|
|
'-g',
|
2017-04-13 20:31:44 +00:00
|
|
|
'-O0' ],
|
2017-10-09 18:30:38 +00:00
|
|
|
'xcode_settings': {
|
2018-11-20 16:26:48 +00:00
|
|
|
'OTHER_CFLAGS': [
|
2017-10-09 18:30:38 +00:00
|
|
|
'--coverage',
|
|
|
|
'-g',
|
|
|
|
'-O0'
|
|
|
|
],
|
2018-11-20 16:26:48 +00:00
|
|
|
},
|
|
|
|
'conditions': [
|
|
|
|
[ '_type=="executable"', {
|
|
|
|
'xcode_settings': {
|
|
|
|
'OTHER_LDFLAGS': [ '--coverage', ],
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
],
|
2017-10-09 18:30:38 +00:00
|
|
|
}],
|
2016-10-18 14:41:26 +00:00
|
|
|
[ 'OS=="sunos"', {
|
|
|
|
'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ],
|
|
|
|
}],
|
2018-05-03 08:51:56 +00:00
|
|
|
[ 'OS in "freebsd linux"', {
|
|
|
|
'ldflags': [ '-Wl,-z,relro',
|
|
|
|
'-Wl,-z,now' ]
|
|
|
|
}],
|
2018-03-23 19:16:48 +00: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 00:07:53 +00:00
|
|
|
[ 'node_use_openssl=="true"', {
|
|
|
|
'defines': [ 'HAVE_OPENSSL=1' ],
|
|
|
|
'conditions': [
|
2019-01-09 10:54:08 +00:00
|
|
|
['openssl_fips != "" or openssl_is_fips=="true"', {
|
2017-12-05 00:07:53 +00:00
|
|
|
'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 13:34:42 +00:00
|
|
|
'-Wl,-force_load,<(PRODUCT_DIR)/<(openssl_product)',
|
2017-12-05 00:07:53 +00:00
|
|
|
],
|
|
|
|
},
|
2018-01-17 21:16:14 +00:00
|
|
|
'msvs_settings': {
|
|
|
|
'VCLinkerTool': {
|
|
|
|
'AdditionalOptions': [
|
2018-09-04 01:56:02 +00:00
|
|
|
'/WHOLEARCHIVE:<(openssl_product)',
|
2018-01-17 21:16:14 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2017-12-05 00:07:53 +00:00
|
|
|
'conditions': [
|
|
|
|
['OS in "linux freebsd" and node_shared=="false"', {
|
|
|
|
'ldflags': [
|
|
|
|
'-Wl,--whole-archive,'
|
2018-01-17 21:16:14 +00:00
|
|
|
'<(obj_dir)/deps/openssl/<(openssl_product)',
|
2017-12-05 00:07:53 +00: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 14:41:26 +00:00
|
|
|
],
|
|
|
|
}
|