Skip to content

Commit 8c66dee

Browse files
committed
Fix gyps for common.gypi removal in chromium repo
1 parent 3ad3ebc commit 8c66dee

File tree

4 files changed

+153
-20
lines changed

4 files changed

+153
-20
lines changed

common.gypi

Lines changed: 113 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
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',
@@ -28,9 +29,10 @@
2829
# Enable disassembler for `--print-code` v8 options
2930
'v8_enable_disassembler': 1,
3031

31-
# Don't bake anything extra into the snapshot.
32-
'v8_use_external_startup_data%': 0,
33-
32+
'v8_use_external_startup_data': 1,
33+
'v8_enable_i18n_support%': 1,
34+
#'icu_use_data_file_flag%': 1,
35+
'win_fastlink': 0,
3436

3537
# Don't use ICU data file (icudtl.dat) from V8, we use our own.
3638
'icu_use_data_file_flag%': 0,
@@ -42,10 +44,11 @@
4244
}, {
4345
'os_posix': 1,
4446
'v8_postmortem_support%': 'true',
47+
'clang_dir': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts',
4548
}],
4649
['GENERATOR == "ninja" or OS== "mac"', {
4750
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
48-
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
51+
#'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
4952
}, {
5053
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
5154
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
@@ -63,6 +66,16 @@
6366
],
6467
},
6568

69+
'conditions': [
70+
[ 'clang==1 and OS != "mac"', {
71+
'make_global_settings': [
72+
['CC', '<(clang_dir)/bin/clang'],
73+
['CXX', '<(clang_dir)/bin/clang++'],
74+
['CC.host', '$(CC)'],
75+
['CXX.host', '$(CXX)'],
76+
],
77+
}],
78+
],
6679
'target_defaults': {
6780
'default_configuration': 'Release',
6881
'variables': {
@@ -79,7 +92,82 @@
7992
],
8093
},
8194
'configurations': {
82-
'Debug': {
95+
'Common_Base': {
96+
'abstract': 1,
97+
'msvs_settings':{
98+
'VCCLCompilerTool': {
99+
'AdditionalOptions': [
100+
'/bigobj',
101+
# Tell the compiler to crash on failures. This is undocumented
102+
# and unsupported but very handy.
103+
'/d2FastFail',
104+
],
105+
},
106+
'VCLinkerTool': {
107+
# Add the default import libs.
108+
'AdditionalDependencies': [
109+
'kernel32.lib',
110+
'gdi32.lib',
111+
'winspool.lib',
112+
'comdlg32.lib',
113+
'advapi32.lib',
114+
'shell32.lib',
115+
'ole32.lib',
116+
'oleaut32.lib',
117+
'user32.lib',
118+
'uuid.lib',
119+
'odbc32.lib',
120+
'odbccp32.lib',
121+
'delayimp.lib',
122+
'credui.lib',
123+
'dbghelp.lib',
124+
'shlwapi.lib',
125+
'winmm.lib',
126+
],
127+
'AdditionalOptions': [
128+
# Suggested by Microsoft Devrel to avoid
129+
# LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
130+
# which started happening more regularly after VS2013 Update 4.
131+
# Needs to be a bit lower for VS2015, or else errors out.
132+
'/maxilksize:0x7ff00000',
133+
# Tell the linker to crash on failures.
134+
'/fastfail',
135+
],
136+
},
137+
},
138+
'conditions': [
139+
['OS=="win" and win_fastlink==1 and MSVS_VERSION != "2013"', {
140+
'msvs_settings': {
141+
'VCLinkerTool': {
142+
# /PROFILE is incompatible with /debug:fastlink
143+
'Profile': 'false',
144+
'AdditionalOptions': [
145+
# Tell VS 2015+ to create a PDB that references debug
146+
# information in .obj and .lib files instead of copying
147+
# it all.
148+
'/DEBUG:FASTLINK',
149+
],
150+
},
151+
},
152+
}],
153+
['OS=="win" and MSVS_VERSION == "2015"', {
154+
'msvs_settings': {
155+
'VCCLCompilerTool': {
156+
'AdditionalOptions': [
157+
# Work around crbug.com/526851, bug in VS 2015 RTM compiler.
158+
'/Zc:sizedDealloc-',
159+
# Disable thread-safe statics to avoid overhead and because
160+
# they are disabled on other platforms. See crbug.com/587210
161+
# and -fno-threadsafe-statics.
162+
'/Zc:threadSafeInit-',
163+
],
164+
},
165+
},
166+
}],
167+
],
168+
},
169+
'Debug_Base': {
170+
'abstract': 1,
83171
'variables': {
84172
'v8_enable_handle_zapping': 1,
85173
},
@@ -114,7 +202,8 @@
114202
'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
115203
},
116204
},
117-
'Release': {
205+
'Release_Base': {
206+
'abstract': 1,
118207
'variables': {
119208
'v8_enable_handle_zapping': 0,
120209
},
@@ -162,7 +251,19 @@
162251
'LinkIncremental': 1, # disable incremental linking
163252
},
164253
},
165-
}
254+
},
255+
'Debug': {
256+
'inherit_from': ['Common_Base', 'Debug_Base'],
257+
},
258+
'Release': {
259+
'inherit_from': ['Common_Base', 'Release_Base'],
260+
},
261+
'conditions': [
262+
[ 'OS=="win"', {
263+
'Debug_x64': { 'inherit_from': ['Debug'] },
264+
'Release_x64': { 'inherit_from': ['Release'], },
265+
}],
266+
],
166267
},
167268
# Forcibly disable -Werror. We support a wide range of compilers, it's
168269
# simply not feasible to squelch all warnings, never mind that the
@@ -208,7 +309,7 @@
208309
'SuppressStartupBanner': 'true',
209310
},
210311
},
211-
'msvs_disabled_warnings': [4351, 4355, 4800],
312+
'msvs_disabled_warnings': [4351, 4355, 4800, 4595],
212313
'conditions': [
213314
['asan == 1 and OS != "mac"', {
214315
'cflags+': [
@@ -249,13 +350,13 @@
249350
'_CRT_NONSTDC_NO_DEPRECATE',
250351
# Make sure the STL doesn't try to use exceptions
251352
'_HAS_EXCEPTIONS=0',
252-
'BUILDING_V8_SHARED=1',
353+
#'BUILDING_V8_SHARED=1',
253354
'BUILDING_UV_SHARED=1',
254355
],
255356
}],
256357
[ 'OS in "linux freebsd openbsd solaris aix"', {
257-
'cflags': [ '-pthread', ],
258-
'ldflags': [ '-pthread' ],
358+
'cflags': [ '-pthread'],
359+
'ldflags': [ '-pthread'],
259360
}],
260361
[ 'OS in "linux freebsd openbsd solaris android aix"', {
261362
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],

deps/openssl/openssl.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
]
175175
}],
176176
['is_clang==1 or gcc_version>=43', {
177-
'cflags': ['-Wno-error=unused-command-line-argument', '-Wno-error=parentheses-equality'],
177+
#'cflags': ['-Wno-error=unused-command-line-argument', '-Wno-error=parentheses-equality'],
178178
}],
179179
['OS=="solaris"', {
180180
'defines': ['__EXTENSIONS__'],

node.gyp

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
'variables': {
3+
'icu_gyp_path%': '../icu/icu.gyp',
34
'v8_use_snapshot%': 'false',
45
'node_use_dtrace%': 'false',
56
'node_use_lttng%': 'false',
@@ -19,7 +20,7 @@
1920
'node_shared_libuv%': 'false',
2021
'node_use_openssl': 'true',
2122
'node_shared_openssl': 'false',
22-
'openssl_fips%': '',
23+
'openssl_fips': '',
2324
'node_v8_options%': '',
2425
'node_enable_v8_vtunejit%': 'false',
2526
'node_core_target_name%': 'node',
@@ -281,6 +282,7 @@
281282
'BUILDING_NW_NODE=1',
282283
'V8_SHARED',
283284
'USING_V8_SHARED',
285+
'V8_USE_EXTERNAL_STARTUP_DATA'
284286
],
285287

286288

@@ -351,8 +353,8 @@
351353
[ 'v8_enable_i18n_support==1', {
352354
'defines': [ 'NODE_HAVE_I18N_SUPPORT=1' ],
353355
'dependencies': [
354-
'<(icu_gyp_path):icui18n',
355-
'<(icu_gyp_path):icuuc',
356+
'../icu/icu.gyp:icui18n',
357+
'../icu/icu.gyp:icuuc',
356358
],
357359
'conditions': [
358360
[ 'icu_small=="true"', {
@@ -635,7 +637,39 @@
635637
'<(V8_PLTFRM)',
636638
'-Wl,--no-whole-archive' ]
637639
}],
638-
[ 'OS=="mac"', {
640+
[ 'OS=="mac" and component == "shared_library"', {
641+
'xcode_settings': {
642+
'OTHER_LDFLAGS': [
643+
'-L<(PRODUCT_DIR)/../nw/', '-lv8',
644+
'<(PRODUCT_DIR)/../nw/nwjs\ Framework.framework/nwjs\ Framework',
645+
'-Wl,-force_load <(V8_BASE)',
646+
'-Wl,-force_load <(V8_PLTFRM)',
647+
],
648+
},
649+
'postbuilds': [
650+
{
651+
'postbuild_name': 'Fix iculib Link',
652+
'action': [
653+
'install_name_tool',
654+
'-change',
655+
'/usr/local/lib/libicuuc.dylib',
656+
'@rpath/libicuuc.dylib',
657+
'${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
658+
],
659+
},
660+
{
661+
'postbuild_name': 'Fix iculib Link2',
662+
'action': [
663+
'install_name_tool',
664+
'-change',
665+
'/usr/local/lib/libicui18n.dylib',
666+
'@rpath/libicui18n.dylib',
667+
'${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
668+
],
669+
},
670+
],
671+
}],
672+
[ 'OS=="mac" and component != "shared_library"', {
639673
'xcode_settings': {
640674
'OTHER_LDFLAGS': [
641675
#'-L<(PRODUCT_DIR)/../nw/', '-lv8',
@@ -957,7 +991,7 @@
957991
'target_name': 'cctest',
958992
'type': 'executable',
959993
'dependencies': [
960-
'../../testing/gtest.gyp:gtest',
994+
#'../../testing/gtest.gyp:gtest',
961995
'../../v8/src/v8.gyp:v8',
962996
'../../v8/src/v8.gyp:v8_libplatform'
963997
],

src/node.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,6 @@ void PromiseRejectCallback(PromiseRejectMessage message) {
12111211

12121212
void SetupPromises(const FunctionCallbackInfo<Value>& args) {
12131213
Environment* env = Environment::GetCurrent(args);
1214-
Isolate* isolate = env->isolate();
12151214

12161215
CHECK(args[0]->IsFunction());
12171216

@@ -4952,7 +4951,6 @@ NODE_EXTERN void g_stop_nw_instance() {
49524951
return;
49534952
struct thread_ctx_st* tls_ctx = (struct thread_ctx_st*)uv_key_get(&thread_ctx_key);
49544953
assert(tls_ctx);
4955-
v8::Isolate* isolate = v8::Isolate::GetCurrent();
49564954
bool more;
49574955
uv_timer_t quit_timer;
49584956
uv_loop_t* loop = tls_ctx->env->event_loop();

0 commit comments

Comments
 (0)