Skip to content

Commit deb9bc6

Browse files
committed
nwjs master
1 parent 0b894f5 commit deb9bc6

File tree

5,002 files changed

+1396
-535692
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

+1396
-535692
lines changed

common.gypi

Lines changed: 155 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@
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',
18+
'node_debug_lib': 'false',
1819
'node_module_version%': '',
20+
'mac_product_name': 'nwjs',
1921

2022
'node_tag%': '',
2123
'uv_library%': 'static_library',
2224

23-
'openssl_fips%': '',
25+
'openssl_fips': '',
26+
'llvm_version': '6.0',
2427

2528
# Default to -O0 for debug builds.
2629
'v8_optimized_debug%': 0,
@@ -31,25 +34,25 @@
3134

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

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

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

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

4555
'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-
}],
5356
['OS == "win"', {
5457
'os_posix': 0,
5558
'v8_postmortem_support%': 'false',
@@ -58,10 +61,27 @@
5861
}, {
5962
'os_posix': 1,
6063
'v8_postmortem_support%': 'true',
64+
'clang_dir': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts',
65+
}],
66+
['OS=="linux" and target_arch=="ia32" and <(building_nw)==1', {
67+
'sysroot': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_i386-sysroot',
68+
}],
69+
['OS=="linux" and target_arch=="x64" and <(building_nw)==1', {
70+
'sysroot': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_amd64-sysroot',
6171
}],
6272
['OS== "mac"', {
63-
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
64-
'v8_base': '<(PRODUCT_DIR)/libv8_base.a',
73+
'obj_dir': '<(PRODUCT_DIR)/obj.target',
74+
#'v8_base': '<(PRODUCT_DIR)/libv8_base.a',
75+
}, {
76+
'conditions': [
77+
['GENERATOR=="ninja"', {
78+
'obj_dir': '<(PRODUCT_DIR)/obj',
79+
'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
80+
}, {
81+
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
82+
'v8_base%': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
83+
}],
84+
],
6585
}],
6686
['openssl_fips != ""', {
6787
'openssl_product': '<(STATIC_LIB_PREFIX)crypto<(STATIC_LIB_SUFFIX)',
@@ -76,10 +96,108 @@
7696
],
7797
},
7898

99+
'conditions': [
100+
[ 'clang==1 and OS != "mac" and building_nw==1', {
101+
'make_global_settings': [
102+
['CC', '<(clang_dir)/bin/clang'],
103+
['CXX', '<(clang_dir)/bin/clang++'],
104+
['CC.host', '$(CC)'],
105+
['CXX.host', '$(CXX)'],
106+
],
107+
}],
108+
],
79109
'target_defaults': {
80110
'default_configuration': 'Release',
111+
'variables': {
112+
'conditions': [
113+
['OS=="win" and component=="shared_library"', {
114+
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx
115+
'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
116+
'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
117+
}, {
118+
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx
119+
'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
120+
'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
121+
}],
122+
],
123+
},
81124
'configurations': {
82-
'Debug': {
125+
'Common_Base': {
126+
'abstract': 1,
127+
'msvs_settings':{
128+
'VCCLCompilerTool': {
129+
'AdditionalOptions': [
130+
'/bigobj',
131+
# Tell the compiler to crash on failures. This is undocumented
132+
# and unsupported but very handy.
133+
'/d2FastFail',
134+
],
135+
},
136+
'VCLinkerTool': {
137+
# Add the default import libs.
138+
'AdditionalDependencies': [
139+
'kernel32.lib',
140+
'gdi32.lib',
141+
'winspool.lib',
142+
'comdlg32.lib',
143+
'advapi32.lib',
144+
'shell32.lib',
145+
'ole32.lib',
146+
'oleaut32.lib',
147+
'user32.lib',
148+
'uuid.lib',
149+
'odbc32.lib',
150+
'odbccp32.lib',
151+
'delayimp.lib',
152+
'credui.lib',
153+
'dbghelp.lib',
154+
'shlwapi.lib',
155+
'winmm.lib',
156+
],
157+
'AdditionalOptions': [
158+
# Suggested by Microsoft Devrel to avoid
159+
# LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
160+
# which started happening more regularly after VS2013 Update 4.
161+
# Needs to be a bit lower for VS2015, or else errors out.
162+
'/maxilksize:0x7ff00000',
163+
# Tell the linker to crash on failures.
164+
'/fastfail',
165+
],
166+
},
167+
},
168+
'conditions': [
169+
['OS=="win" and win_fastlink==1 and MSVS_VERSION != "2013"', {
170+
'msvs_settings': {
171+
'VCLinkerTool': {
172+
# /PROFILE is incompatible with /debug:fastlink
173+
'Profile': 'false',
174+
'AdditionalOptions': [
175+
# Tell VS 2015+ to create a PDB that references debug
176+
# information in .obj and .lib files instead of copying
177+
# it all.
178+
'/DEBUG:FASTLINK',
179+
],
180+
},
181+
},
182+
}],
183+
['OS=="win" and MSVS_VERSION == "2015"', {
184+
'msvs_settings': {
185+
'VCCLCompilerTool': {
186+
'AdditionalOptions': [
187+
# Work around crbug.com/526851, bug in VS 2015 RTM compiler.
188+
'/Zc:sizedDealloc-',
189+
# Disable thread-safe statics to avoid overhead and because
190+
# they are disabled on other platforms. See crbug.com/587210
191+
# and -fno-threadsafe-statics.
192+
'/Zc:threadSafeInit-',
193+
],
194+
},
195+
},
196+
}],
197+
],
198+
},
199+
'Debug_Base': {
200+
'abstract': 1,
83201
'variables': {
84202
'v8_enable_handle_zapping': 1,
85203
},
@@ -97,23 +215,10 @@
97215
'cflags': [ '-fPIE' ],
98216
'ldflags': [ '-fPIE', '-pie' ]
99217
}],
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-
}]
114218
],
115219
'msvs_settings': {
116220
'VCCLCompilerTool': {
221+
'RuntimeLibrary': '<(win_debug_RuntimeLibrary)', # static debug
117222
'Optimization': 0, # /Od, no optimization
118223
'MinimalRebuild': 'false',
119224
'OmitFramePointers': 'false',
@@ -131,7 +236,8 @@
131236
'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
132237
},
133238
},
134-
'Release': {
239+
'Release_Base': {
240+
'abstract': 1,
135241
'variables': {
136242
'v8_enable_handle_zapping': 0,
137243
},
@@ -151,23 +257,10 @@
151257
'cflags': [ '-fPIE' ],
152258
'ldflags': [ '-fPIE', '-pie' ]
153259
}],
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-
}]
168260
],
169261
'msvs_settings': {
170262
'VCCLCompilerTool': {
263+
'RuntimeLibrary': '<(win_release_RuntimeLibrary)', # static release
171264
'Optimization': 3, # /Ox, full optimization
172265
'FavorSizeOrSpeed': 1, # /Ot, favor speed over size
173266
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
@@ -194,7 +287,19 @@
194287
],
195288
},
196289
},
197-
}
290+
},
291+
'Debug': {
292+
'inherit_from': ['Common_Base', 'Debug_Base'],
293+
},
294+
'Release': {
295+
'inherit_from': ['Common_Base', 'Release_Base'],
296+
},
297+
'conditions': [
298+
[ 'OS=="win"', {
299+
'Debug_x64': { 'inherit_from': ['Debug'] },
300+
'Release_x64': { 'inherit_from': ['Release'], },
301+
}],
302+
],
198303
},
199304
# Forcibly disable -Werror. We support a wide range of compilers, it's
200305
# simply not feasible to squelch all warnings, never mind that the
@@ -242,7 +347,7 @@
242347
'SuppressStartupBanner': 'true',
243348
},
244349
},
245-
'msvs_disabled_warnings': [4351, 4355, 4800],
350+
'msvs_disabled_warnings': [4351, 4355, 4800, 4595],
246351
'conditions': [
247352
['asan == 1 and OS != "mac"', {
248353
'cflags+': [
@@ -283,7 +388,7 @@
283388
'_CRT_NONSTDC_NO_DEPRECATE',
284389
# Make sure the STL doesn't try to use exceptions
285390
'_HAS_EXCEPTIONS=0',
286-
'BUILDING_V8_SHARED=1',
391+
#'BUILDING_V8_SHARED=1',
287392
'BUILDING_UV_SHARED=1',
288393
],
289394
}],
@@ -318,6 +423,10 @@
318423
'cflags': [ '-m64' ],
319424
'ldflags': [ '-m64' ],
320425
}],
426+
[ 'building_nw==1', {
427+
'cflags': [ '--sysroot=<(sysroot)' ],
428+
'ldflags': [ '--sysroot=<(sysroot)','<!(<(DEPTH)/content/nw/tools/sysroot_ld_path.sh <(sysroot))' ],
429+
}],
321430
[ 'target_arch=="ppc" and OS!="aix"', {
322431
'cflags': [ '-m32' ],
323432
'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)