Skip to content

Commit

Permalink
nwjs master
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Mar 23, 2018
1 parent 74fb02f commit 6b07cd8
Show file tree
Hide file tree
Showing 5,002 changed files with 1,394 additions and 535,691 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
200 changes: 154 additions & 46 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
'python%': 'python',

'node_shared%': 'false',
'node_shared%': 'true',
'force_dynamic_crt%': 0,
'node_use_v8_platform%': 'true',
'node_use_bundled_v8%': 'true',
'node_module_version%': '',
'mac_product_name': 'nwjs',

'node_tag%': '',
'uv_library%': 'static_library',

'openssl_fips%': '',
'openssl_fips': '',
'llvm_version': '6.0',

# Default to -O0 for debug builds.
'v8_optimized_debug%': 0,
Expand All @@ -31,25 +33,25 @@

# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,
'v8_host_byteorder': '<!(python -c "import sys; print sys.byteorder")',

# Don't bake anything extra into the snapshot.
'v8_use_external_startup_data%': 0,
'v8_use_external_startup_data': 1,
'v8_enable_i18n_support%': 1,
#'icu_use_data_file_flag%': 1,
'win_fastlink': 0,

# Some STL containers (e.g. std::vector) do not preserve ABI compatibility
# between debug and non-debug mode.
'disable_glibcxx_debug': 1,

# Don't use ICU data file (icudtl.dat) from V8, we use our own.
'icu_use_data_file_flag%': 0,
'variables': {
'building_nw%' : 0,
},
'building_nw%' : '<(building_nw)',

'conditions': [
['GENERATOR=="ninja"', {
'obj_dir': '<(PRODUCT_DIR)/obj',
'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
}, {
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
'v8_base%': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
}],
['OS == "win"', {
'os_posix': 0,
'v8_postmortem_support%': 'false',
Expand All @@ -58,10 +60,27 @@
}, {
'os_posix': 1,
'v8_postmortem_support%': 'true',
'clang_dir': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts',
}],
['OS=="linux" and target_arch=="ia32" and <(building_nw)==1', {
'sysroot': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_i386-sysroot',
}],
['OS=="linux" and target_arch=="x64" and <(building_nw)==1', {
'sysroot': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_amd64-sysroot',
}],
['OS== "mac"', {
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
'v8_base': '<(PRODUCT_DIR)/libv8_base.a',
'obj_dir': '<(PRODUCT_DIR)/obj.target',
#'v8_base': '<(PRODUCT_DIR)/libv8_base.a',
}, {
'conditions': [
['GENERATOR=="ninja"', {
'obj_dir': '<(PRODUCT_DIR)/obj',
'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
}, {
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
'v8_base%': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
}],
],
}],
['openssl_fips != ""', {
'openssl_product': '<(STATIC_LIB_PREFIX)crypto<(STATIC_LIB_SUFFIX)',
Expand All @@ -76,10 +95,108 @@
],
},

'conditions': [
[ 'clang==1 and OS != "mac" and building_nw==1', {
'make_global_settings': [
['CC', '<(clang_dir)/bin/clang'],
['CXX', '<(clang_dir)/bin/clang++'],
['CC.host', '$(CC)'],
['CXX.host', '$(CXX)'],
],
}],
],
'target_defaults': {
'default_configuration': 'Release',
'variables': {
'conditions': [
['OS=="win" and component=="shared_library"', {
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx
'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
}, {
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx
'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
}],
],
},
'configurations': {
'Debug': {
'Common_Base': {
'abstract': 1,
'msvs_settings':{
'VCCLCompilerTool': {
'AdditionalOptions': [
'/bigobj',
# Tell the compiler to crash on failures. This is undocumented
# and unsupported but very handy.
'/d2FastFail',
],
},
'VCLinkerTool': {
# Add the default import libs.
'AdditionalDependencies': [
'kernel32.lib',
'gdi32.lib',
'winspool.lib',
'comdlg32.lib',
'advapi32.lib',
'shell32.lib',
'ole32.lib',
'oleaut32.lib',
'user32.lib',
'uuid.lib',
'odbc32.lib',
'odbccp32.lib',
'delayimp.lib',
'credui.lib',
'dbghelp.lib',
'shlwapi.lib',
'winmm.lib',
],
'AdditionalOptions': [
# Suggested by Microsoft Devrel to avoid
# LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
# which started happening more regularly after VS2013 Update 4.
# Needs to be a bit lower for VS2015, or else errors out.
'/maxilksize:0x7ff00000',
# Tell the linker to crash on failures.
'/fastfail',
],
},
},
'conditions': [
['OS=="win" and win_fastlink==1 and MSVS_VERSION != "2013"', {
'msvs_settings': {
'VCLinkerTool': {
# /PROFILE is incompatible with /debug:fastlink
'Profile': 'false',
'AdditionalOptions': [
# Tell VS 2015+ to create a PDB that references debug
# information in .obj and .lib files instead of copying
# it all.
'/DEBUG:FASTLINK',
],
},
},
}],
['OS=="win" and MSVS_VERSION == "2015"', {
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [
# Work around crbug.com/526851, bug in VS 2015 RTM compiler.
'/Zc:sizedDealloc-',
# Disable thread-safe statics to avoid overhead and because
# they are disabled on other platforms. See crbug.com/587210
# and -fno-threadsafe-statics.
'/Zc:threadSafeInit-',
],
},
},
}],
],
},
'Debug_Base': {
'abstract': 1,
'variables': {
'v8_enable_handle_zapping': 1,
},
Expand All @@ -97,23 +214,10 @@
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}],
['node_shared=="true"', {
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 3, # MultiThreadedDebugDLL (/MDd)
}
}
}],
['node_shared=="false"', {
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1 # MultiThreadedDebug (/MTd)
}
}
}]
],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': '<(win_debug_RuntimeLibrary)', # static debug
'Optimization': 0, # /Od, no optimization
'MinimalRebuild': 'false',
'OmitFramePointers': 'false',
Expand All @@ -131,7 +235,8 @@
'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
},
},
'Release': {
'Release_Base': {
'abstract': 1,
'variables': {
'v8_enable_handle_zapping': 0,
},
Expand All @@ -151,23 +256,10 @@
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}],
['node_shared=="true"', {
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 2 # MultiThreadedDLL (/MD)
}
}
}],
['node_shared=="false"', {
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0 # MultiThreaded (/MT)
}
}
}]
],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': '<(win_release_RuntimeLibrary)', # static release
'Optimization': 3, # /Ox, full optimization
'FavorSizeOrSpeed': 1, # /Ot, favor speed over size
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
Expand All @@ -194,7 +286,19 @@
],
},
},
}
},
'Debug': {
'inherit_from': ['Common_Base', 'Debug_Base'],
},
'Release': {
'inherit_from': ['Common_Base', 'Release_Base'],
},
'conditions': [
[ 'OS=="win"', {
'Debug_x64': { 'inherit_from': ['Debug'] },
'Release_x64': { 'inherit_from': ['Release'], },
}],
],
},
# Forcibly disable -Werror. We support a wide range of compilers, it's
# simply not feasible to squelch all warnings, never mind that the
Expand Down Expand Up @@ -242,7 +346,7 @@
'SuppressStartupBanner': 'true',
},
},
'msvs_disabled_warnings': [4351, 4355, 4800],
'msvs_disabled_warnings': [4351, 4355, 4800, 4595],
'conditions': [
['asan == 1 and OS != "mac"', {
'cflags+': [
Expand Down Expand Up @@ -283,7 +387,7 @@
'_CRT_NONSTDC_NO_DEPRECATE',
# Make sure the STL doesn't try to use exceptions
'_HAS_EXCEPTIONS=0',
'BUILDING_V8_SHARED=1',
#'BUILDING_V8_SHARED=1',
'BUILDING_UV_SHARED=1',
],
}],
Expand Down Expand Up @@ -318,6 +422,10 @@
'cflags': [ '-m64' ],
'ldflags': [ '-m64' ],
}],
[ 'building_nw==1', {
'cflags': [ '--sysroot=<(sysroot)' ],
'ldflags': [ '--sysroot=<(sysroot)','<!(<(DEPTH)/content/nw/tools/sysroot_ld_path.sh <(sysroot))' ],
}],
[ 'target_arch=="ppc" and OS!="aix"', {
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
Expand Down
41 changes: 41 additions & 0 deletions config.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Do not edit. Generated by the configure script.
{ 'target_defaults': { 'cflags': [],
'default_configuration': 'Release',
'defines': ['OPENSSL_NO_SSL2=1'],
'include_dirs': [],
'libraries': []},
'variables': { 'clang': 1,
'gcc_version': 49,
'host_arch': 'x64',
'icu_small': 'false',
'node_install_npm': 'true',
'node_prefix': '',
'node_shared': 'true',
'node_shared_http_parser': 'false',
'node_shared_libuv': 'false',
'debug_http2': 0,
'debug_nghttp2': 0,
'node_shared_openssl': 'false',
'node_shared_v8': 'false',
'node_shared_zlib': 'false',
'node_tag': '',
'node_release_urlbase': '',
'node_byteorder': 'little',
'node_use_dtrace': 'false',
'node_use_etw': 'false',
'node_use_mdb': 'false',
'node_use_openssl': 'true',
'node_use_perfctr': 'false',
'openssl_no_asm': 0,
'python': '/usr/bin/python',
'target_arch': 'x64',
'uv_library': 'static_library',
'uv_parent_path': '/deps/uv/',
'uv_use_dtrace': 'false',
'v8_enable_gdbjit': 0,
'v8_enable_i18n_support': 0,
'v8_no_strict_aliasing': 1,
'v8_optimized_debug': 0,
'v8_random_seed': 0,
'v8_use_snapshot': 'true',
'want_separate_host_toolset': 0}}
4 changes: 4 additions & 0 deletions deps/cares/cares.gyp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
'variables': {
'library%': 'static_library',
},
'target_defaults': {
'conditions': [
['OS!="win"', {
Expand Down Expand Up @@ -113,6 +116,7 @@
[ 'OS=="win"', {
'defines': [ 'CARES_PULL_WS2TCPIP_H=1' ],
'include_dirs': [ 'config/win32' ],
'msvs_disabled_warnings': [4133],
'sources': [
'src/config-win32.h',
'src/windows_port.c',
Expand Down
9 changes: 9 additions & 0 deletions deps/cares/src/ares_create_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

#include "ares_setup.h"

#ifndef _WIN32
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warray-bounds"
#endif

#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
Expand Down Expand Up @@ -200,3 +205,7 @@ int ares_create_query(const char *name, int dnsclass, int type,

return ARES_SUCCESS;
}

#ifndef _WIN32
#pragma clang diagnostic pop
#endif
2 changes: 1 addition & 1 deletion deps/cares/src/ares_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
else
fromlen = sizeof(from.sa6);
count = socket_recvfrom(channel, server->udp_socket, (void *)buf,
sizeof(buf), 0, &from.sa, &fromlen);
sizeof(buf), 0, &from.sa, (socklen_t *)&fromlen);
}

if (count == -1 && try_again(SOCKERRNO))
Expand Down
Loading

0 comments on commit 6b07cd8

Please sign in to comment.