Skip to content

Commit bb519db

Browse files
committed
nwjs master
1 parent c3c9984 commit bb519db

File tree

5,002 files changed

+1394
-535691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,002 files changed

+1394
-535691
lines changed

common.gypi

Lines changed: 154 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@
1111
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
1212
'python%': 'python',
1313

14-
'node_shared%': 'false',
14+
'node_shared%': 'true',
1515
'force_dynamic_crt%': 0,
1616
'node_use_v8_platform%': 'true',
1717
'node_use_bundled_v8%': 'true',
1818
'node_module_version%': '',
19+
'mac_product_name': 'nwjs',
1920

2021
'node_tag%': '',
2122
'uv_library%': 'static_library',
2223

23-
'openssl_fips%': '',
24+
'openssl_fips': '',
25+
'llvm_version': '6.0',
2426

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

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

35-
# Don't bake anything extra into the snapshot.
36-
'v8_use_external_startup_data%': 0,
38+
'v8_use_external_startup_data': 1,
39+
'v8_enable_i18n_support%': 1,
40+
#'icu_use_data_file_flag%': 1,
41+
'win_fastlink': 0,
3742

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

4247
# Don't use ICU data file (icudtl.dat) from V8, we use our own.
4348
'icu_use_data_file_flag%': 0,
49+
'variables': {
50+
'building_nw%' : 0,
51+
},
52+
'building_nw%' : '<(building_nw)',
4453

4554
'conditions': [
46-
['GENERATOR=="ninja"', {
47-
'obj_dir': '<(PRODUCT_DIR)/obj',
48-
'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
49-
}, {
50-
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
51-
'v8_base%': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
52-
}],
5355
['OS == "win"', {
5456
'os_posix': 0,
5557
'v8_postmortem_support%': 'false',
@@ -58,10 +60,27 @@
5860
}, {
5961
'os_posix': 1,
6062
'v8_postmortem_support%': 'true',
63+
'clang_dir': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts',
64+
}],
65+
['OS=="linux" and target_arch=="ia32" and <(building_nw)==1', {
66+
'sysroot': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_i386-sysroot',
67+
}],
68+
['OS=="linux" and target_arch=="x64" and <(building_nw)==1', {
69+
'sysroot': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_amd64-sysroot',
6170
}],
6271
['OS== "mac"', {
63-
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
64-
'v8_base': '<(PRODUCT_DIR)/libv8_base.a',
72+
'obj_dir': '<(PRODUCT_DIR)/obj.target',
73+
#'v8_base': '<(PRODUCT_DIR)/libv8_base.a',
74+
}, {
75+
'conditions': [
76+
['GENERATOR=="ninja"', {
77+
'obj_dir': '<(PRODUCT_DIR)/obj',
78+
'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
79+
}, {
80+
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
81+
'v8_base%': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
82+
}],
83+
],
6584
}],
6685
['openssl_fips != ""', {
6786
'openssl_product': '<(STATIC_LIB_PREFIX)crypto<(STATIC_LIB_SUFFIX)',
@@ -76,10 +95,108 @@
7695
],
7796
},
7897

98+
'conditions': [
99+
[ 'clang==1 and OS != "mac" and building_nw==1', {
100+
'make_global_settings': [
101+
['CC', '<(clang_dir)/bin/clang'],
102+
['CXX', '<(clang_dir)/bin/clang++'],
103+
['CC.host', '$(CC)'],
104+
['CXX.host', '$(CXX)'],
105+
],
106+
}],
107+
],
79108
'target_defaults': {
80109
'default_configuration': 'Release',
110+
'variables': {
111+
'conditions': [
112+
['OS=="win" and component=="shared_library"', {
113+
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx
114+
'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
115+
'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
116+
}, {
117+
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx
118+
'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
119+
'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
120+
}],
121+
],
122+
},
81123
'configurations': {
82-
'Debug': {
124+
'Common_Base': {
125+
'abstract': 1,
126+
'msvs_settings':{
127+
'VCCLCompilerTool': {
128+
'AdditionalOptions': [
129+
'/bigobj',
130+
# Tell the compiler to crash on failures. This is undocumented
131+
# and unsupported but very handy.
132+
'/d2FastFail',
133+
],
134+
},
135+
'VCLinkerTool': {
136+
# Add the default import libs.
137+
'AdditionalDependencies': [
138+
'kernel32.lib',
139+
'gdi32.lib',
140+
'winspool.lib',
141+
'comdlg32.lib',
142+
'advapi32.lib',
143+
'shell32.lib',
144+
'ole32.lib',
145+
'oleaut32.lib',
146+
'user32.lib',
147+
'uuid.lib',
148+
'odbc32.lib',
149+
'odbccp32.lib',
150+
'delayimp.lib',
151+
'credui.lib',
152+
'dbghelp.lib',
153+
'shlwapi.lib',
154+
'winmm.lib',
155+
],
156+
'AdditionalOptions': [
157+
# Suggested by Microsoft Devrel to avoid
158+
# LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
159+
# which started happening more regularly after VS2013 Update 4.
160+
# Needs to be a bit lower for VS2015, or else errors out.
161+
'/maxilksize:0x7ff00000',
162+
# Tell the linker to crash on failures.
163+
'/fastfail',
164+
],
165+
},
166+
},
167+
'conditions': [
168+
['OS=="win" and win_fastlink==1 and MSVS_VERSION != "2013"', {
169+
'msvs_settings': {
170+
'VCLinkerTool': {
171+
# /PROFILE is incompatible with /debug:fastlink
172+
'Profile': 'false',
173+
'AdditionalOptions': [
174+
# Tell VS 2015+ to create a PDB that references debug
175+
# information in .obj and .lib files instead of copying
176+
# it all.
177+
'/DEBUG:FASTLINK',
178+
],
179+
},
180+
},
181+
}],
182+
['OS=="win" and MSVS_VERSION == "2015"', {
183+
'msvs_settings': {
184+
'VCCLCompilerTool': {
185+
'AdditionalOptions': [
186+
# Work around crbug.com/526851, bug in VS 2015 RTM compiler.
187+
'/Zc:sizedDealloc-',
188+
# Disable thread-safe statics to avoid overhead and because
189+
# they are disabled on other platforms. See crbug.com/587210
190+
# and -fno-threadsafe-statics.
191+
'/Zc:threadSafeInit-',
192+
],
193+
},
194+
},
195+
}],
196+
],
197+
},
198+
'Debug_Base': {
199+
'abstract': 1,
83200
'variables': {
84201
'v8_enable_handle_zapping': 1,
85202
},
@@ -97,23 +214,10 @@
97214
'cflags': [ '-fPIE' ],
98215
'ldflags': [ '-fPIE', '-pie' ]
99216
}],
100-
['node_shared=="true"', {
101-
'msvs_settings': {
102-
'VCCLCompilerTool': {
103-
'RuntimeLibrary': 3, # MultiThreadedDebugDLL (/MDd)
104-
}
105-
}
106-
}],
107-
['node_shared=="false"', {
108-
'msvs_settings': {
109-
'VCCLCompilerTool': {
110-
'RuntimeLibrary': 1 # MultiThreadedDebug (/MTd)
111-
}
112-
}
113-
}]
114217
],
115218
'msvs_settings': {
116219
'VCCLCompilerTool': {
220+
'RuntimeLibrary': '<(win_debug_RuntimeLibrary)', # static debug
117221
'Optimization': 0, # /Od, no optimization
118222
'MinimalRebuild': 'false',
119223
'OmitFramePointers': 'false',
@@ -131,7 +235,8 @@
131235
'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
132236
},
133237
},
134-
'Release': {
238+
'Release_Base': {
239+
'abstract': 1,
135240
'variables': {
136241
'v8_enable_handle_zapping': 0,
137242
},
@@ -151,23 +256,10 @@
151256
'cflags': [ '-fPIE' ],
152257
'ldflags': [ '-fPIE', '-pie' ]
153258
}],
154-
['node_shared=="true"', {
155-
'msvs_settings': {
156-
'VCCLCompilerTool': {
157-
'RuntimeLibrary': 2 # MultiThreadedDLL (/MD)
158-
}
159-
}
160-
}],
161-
['node_shared=="false"', {
162-
'msvs_settings': {
163-
'VCCLCompilerTool': {
164-
'RuntimeLibrary': 0 # MultiThreaded (/MT)
165-
}
166-
}
167-
}]
168259
],
169260
'msvs_settings': {
170261
'VCCLCompilerTool': {
262+
'RuntimeLibrary': '<(win_release_RuntimeLibrary)', # static release
171263
'Optimization': 3, # /Ox, full optimization
172264
'FavorSizeOrSpeed': 1, # /Ot, favor speed over size
173265
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
@@ -194,7 +286,19 @@
194286
],
195287
},
196288
},
197-
}
289+
},
290+
'Debug': {
291+
'inherit_from': ['Common_Base', 'Debug_Base'],
292+
},
293+
'Release': {
294+
'inherit_from': ['Common_Base', 'Release_Base'],
295+
},
296+
'conditions': [
297+
[ 'OS=="win"', {
298+
'Debug_x64': { 'inherit_from': ['Debug'] },
299+
'Release_x64': { 'inherit_from': ['Release'], },
300+
}],
301+
],
198302
},
199303
# Forcibly disable -Werror. We support a wide range of compilers, it's
200304
# simply not feasible to squelch all warnings, never mind that the
@@ -242,7 +346,7 @@
242346
'SuppressStartupBanner': 'true',
243347
},
244348
},
245-
'msvs_disabled_warnings': [4351, 4355, 4800],
349+
'msvs_disabled_warnings': [4351, 4355, 4800, 4595],
246350
'conditions': [
247351
['asan == 1 and OS != "mac"', {
248352
'cflags+': [
@@ -283,7 +387,7 @@
283387
'_CRT_NONSTDC_NO_DEPRECATE',
284388
# Make sure the STL doesn't try to use exceptions
285389
'_HAS_EXCEPTIONS=0',
286-
'BUILDING_V8_SHARED=1',
390+
#'BUILDING_V8_SHARED=1',
287391
'BUILDING_UV_SHARED=1',
288392
],
289393
}],
@@ -318,6 +422,10 @@
318422
'cflags': [ '-m64' ],
319423
'ldflags': [ '-m64' ],
320424
}],
425+
[ 'building_nw==1', {
426+
'cflags': [ '--sysroot=<(sysroot)' ],
427+
'ldflags': [ '--sysroot=<(sysroot)','<!(<(DEPTH)/content/nw/tools/sysroot_ld_path.sh <(sysroot))' ],
428+
}],
321429
[ 'target_arch=="ppc" and OS!="aix"', {
322430
'cflags': [ '-m32' ],
323431
'ldflags': [ '-m32' ],

config.gypi

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Do not edit. Generated by the configure script.
2+
{ 'target_defaults': { 'cflags': [],
3+
'default_configuration': 'Release',
4+
'defines': ['OPENSSL_NO_SSL2=1'],
5+
'include_dirs': [],
6+
'libraries': []},
7+
'variables': { 'clang': 1,
8+
'gcc_version': 49,
9+
'host_arch': 'x64',
10+
'icu_small': 'false',
11+
'node_install_npm': 'true',
12+
'node_prefix': '',
13+
'node_shared': 'true',
14+
'node_shared_http_parser': 'false',
15+
'node_shared_libuv': 'false',
16+
'debug_http2': 0,
17+
'debug_nghttp2': 0,
18+
'node_shared_openssl': 'false',
19+
'node_shared_v8': 'false',
20+
'node_shared_zlib': 'false',
21+
'node_tag': '',
22+
'node_release_urlbase': '',
23+
'node_byteorder': 'little',
24+
'node_use_dtrace': 'false',
25+
'node_use_etw': 'false',
26+
'node_use_mdb': 'false',
27+
'node_use_openssl': 'true',
28+
'node_use_perfctr': 'false',
29+
'openssl_no_asm': 0,
30+
'python': '/usr/bin/python',
31+
'target_arch': 'x64',
32+
'uv_library': 'static_library',
33+
'uv_parent_path': '/deps/uv/',
34+
'uv_use_dtrace': 'false',
35+
'v8_enable_gdbjit': 0,
36+
'v8_enable_i18n_support': 0,
37+
'v8_no_strict_aliasing': 1,
38+
'v8_optimized_debug': 0,
39+
'v8_random_seed': 0,
40+
'v8_use_snapshot': 'true',
41+
'want_separate_host_toolset': 0}}

deps/cares/cares.gyp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
'variables': {
3+
'library%': 'static_library',
4+
},
25
'target_defaults': {
36
'conditions': [
47
['OS!="win"', {
@@ -113,6 +116,7 @@
113116
[ 'OS=="win"', {
114117
'defines': [ 'CARES_PULL_WS2TCPIP_H=1' ],
115118
'include_dirs': [ 'config/win32' ],
119+
'msvs_disabled_warnings': [4133],
116120
'sources': [
117121
'src/config-win32.h',
118122
'src/windows_port.c',

deps/cares/src/ares_create_query.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
#include "ares_setup.h"
1818

19+
#ifndef _WIN32
20+
#pragma clang diagnostic push
21+
#pragma clang diagnostic ignored "-Warray-bounds"
22+
#endif
23+
1924
#ifdef HAVE_NETINET_IN_H
2025
# include <netinet/in.h>
2126
#endif
@@ -200,3 +205,7 @@ int ares_create_query(const char *name, int dnsclass, int type,
200205

201206
return ARES_SUCCESS;
202207
}
208+
209+
#ifndef _WIN32
210+
#pragma clang diagnostic pop
211+
#endif

deps/cares/src/ares_process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
513513
else
514514
fromlen = sizeof(from.sa6);
515515
count = socket_recvfrom(channel, server->udp_socket, (void *)buf,
516-
sizeof(buf), 0, &from.sa, &fromlen);
516+
sizeof(buf), 0, &from.sa, (socklen_t *)&fromlen);
517517
}
518518

519519
if (count == -1 && try_again(SOCKERRNO))

0 commit comments

Comments
 (0)