Skip to content

Commit 20d7e8d

Browse files
committed
Fix gyps for common.gypi removal in chromium repo
1 parent b75f8a8 commit 20d7e8d

3 files changed

Lines changed: 154 additions & 18 deletions

File tree

common.gypi

Lines changed: 114 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,11 @@
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+
'openssl_fips': '',
36+
'win_fastlink': 0,
3437

3538
# Don't use ICU data file (icudtl.dat) from V8, we use our own.
3639
'icu_use_data_file_flag%': 0,
@@ -42,10 +45,11 @@
4245
}, {
4346
'os_posix': 1,
4447
'v8_postmortem_support%': 'true',
48+
'clang_dir': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts',
4549
}],
4650
['GENERATOR == "ninja" or OS== "mac"', {
4751
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
48-
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
52+
#'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
4953
}, {
5054
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
5155
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
@@ -63,6 +67,16 @@
6367
],
6468
},
6569

70+
'conditions': [
71+
[ 'clang==1 and OS != "mac"', {
72+
'make_global_settings': [
73+
['CC', '<(clang_dir)/bin/clang'],
74+
['CXX', '<(clang_dir)/bin/clang++'],
75+
['CC.host', '$(CC)'],
76+
['CXX.host', '$(CXX)'],
77+
],
78+
}],
79+
],
6680
'target_defaults': {
6781
'default_configuration': 'Release',
6882
'variables': {
@@ -79,7 +93,82 @@
7993
],
8094
},
8195
'configurations': {
82-
'Debug': {
96+
'Common_Base': {
97+
'abstract': 1,
98+
'msvs_settings':{
99+
'VCCLCompilerTool': {
100+
'AdditionalOptions': [
101+
'/bigobj',
102+
# Tell the compiler to crash on failures. This is undocumented
103+
# and unsupported but very handy.
104+
'/d2FastFail',
105+
],
106+
},
107+
'VCLinkerTool': {
108+
# Add the default import libs.
109+
'AdditionalDependencies': [
110+
'kernel32.lib',
111+
'gdi32.lib',
112+
'winspool.lib',
113+
'comdlg32.lib',
114+
'advapi32.lib',
115+
'shell32.lib',
116+
'ole32.lib',
117+
'oleaut32.lib',
118+
'user32.lib',
119+
'uuid.lib',
120+
'odbc32.lib',
121+
'odbccp32.lib',
122+
'delayimp.lib',
123+
'credui.lib',
124+
'dbghelp.lib',
125+
'shlwapi.lib',
126+
'winmm.lib',
127+
],
128+
'AdditionalOptions': [
129+
# Suggested by Microsoft Devrel to avoid
130+
# LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
131+
# which started happening more regularly after VS2013 Update 4.
132+
# Needs to be a bit lower for VS2015, or else errors out.
133+
'/maxilksize:0x7ff00000',
134+
# Tell the linker to crash on failures.
135+
'/fastfail',
136+
],
137+
},
138+
},
139+
'conditions': [
140+
['OS=="win" and win_fastlink==1 and MSVS_VERSION != "2013"', {
141+
'msvs_settings': {
142+
'VCLinkerTool': {
143+
# /PROFILE is incompatible with /debug:fastlink
144+
'Profile': 'false',
145+
'AdditionalOptions': [
146+
# Tell VS 2015+ to create a PDB that references debug
147+
# information in .obj and .lib files instead of copying
148+
# it all.
149+
'/DEBUG:FASTLINK',
150+
],
151+
},
152+
},
153+
}],
154+
['OS=="win" and MSVS_VERSION == "2015"', {
155+
'msvs_settings': {
156+
'VCCLCompilerTool': {
157+
'AdditionalOptions': [
158+
# Work around crbug.com/526851, bug in VS 2015 RTM compiler.
159+
'/Zc:sizedDealloc-',
160+
# Disable thread-safe statics to avoid overhead and because
161+
# they are disabled on other platforms. See crbug.com/587210
162+
# and -fno-threadsafe-statics.
163+
'/Zc:threadSafeInit-',
164+
],
165+
},
166+
},
167+
}],
168+
],
169+
},
170+
'Debug_Base': {
171+
'abstract': 1,
83172
'variables': {
84173
'v8_enable_handle_zapping': 1,
85174
},
@@ -114,7 +203,8 @@
114203
'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
115204
},
116205
},
117-
'Release': {
206+
'Release_Base': {
207+
'abstract': 1,
118208
'variables': {
119209
'v8_enable_handle_zapping': 0,
120210
},
@@ -162,7 +252,19 @@
162252
'LinkIncremental': 1, # disable incremental linking
163253
},
164254
},
165-
}
255+
},
256+
'Debug': {
257+
'inherit_from': ['Common_Base', 'Debug_Base'],
258+
},
259+
'Release': {
260+
'inherit_from': ['Common_Base', 'Release_Base'],
261+
},
262+
'conditions': [
263+
[ 'OS=="win"', {
264+
'Debug_x64': { 'inherit_from': ['Debug'] },
265+
'Release_x64': { 'inherit_from': ['Release'], },
266+
}],
267+
],
166268
},
167269
# Forcibly disable -Werror. We support a wide range of compilers, it's
168270
# simply not feasible to squelch all warnings, never mind that the
@@ -208,7 +310,7 @@
208310
'SuppressStartupBanner': 'true',
209311
},
210312
},
211-
'msvs_disabled_warnings': [4351, 4355, 4800],
313+
'msvs_disabled_warnings': [4351, 4355, 4800, 4595],
212314
'conditions': [
213315
['asan == 1 and OS != "mac"', {
214316
'cflags+': [
@@ -249,13 +351,13 @@
249351
'_CRT_NONSTDC_NO_DEPRECATE',
250352
# Make sure the STL doesn't try to use exceptions
251353
'_HAS_EXCEPTIONS=0',
252-
'BUILDING_V8_SHARED=1',
354+
#'BUILDING_V8_SHARED=1',
253355
'BUILDING_UV_SHARED=1',
254356
],
255357
}],
256358
[ 'OS in "linux freebsd openbsd solaris aix"', {
257-
'cflags': [ '-pthread', ],
258-
'ldflags': [ '-pthread' ],
359+
'cflags': [ '-pthread'],
360+
'ldflags': [ '-pthread'],
259361
}],
260362
[ 'OS in "linux freebsd openbsd solaris android aix"', {
261363
'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',
@@ -280,6 +281,7 @@
280281
'BUILDING_NW_NODE=1',
281282
'V8_SHARED',
282283
'USING_V8_SHARED',
284+
'V8_USE_EXTERNAL_STARTUP_DATA'
283285
],
284286

285287

@@ -350,8 +352,8 @@
350352
[ 'v8_enable_i18n_support==1', {
351353
'defines': [ 'NODE_HAVE_I18N_SUPPORT=1' ],
352354
'dependencies': [
353-
'<(icu_gyp_path):icui18n',
354-
'<(icu_gyp_path):icuuc',
355+
'../icu/icu.gyp:icui18n',
356+
'../icu/icu.gyp:icuuc',
355357
],
356358
'conditions': [
357359
[ 'icu_small=="true"', {
@@ -636,7 +638,39 @@
636638
'<(V8_PLTFRM)',
637639
'-Wl,--no-whole-archive' ]
638640
}],
639-
[ 'OS=="mac"', {
641+
[ 'OS=="mac" and component == "shared_library"', {
642+
'xcode_settings': {
643+
'OTHER_LDFLAGS': [
644+
'-L<(PRODUCT_DIR)/../nw/', '-lv8',
645+
'<(PRODUCT_DIR)/../nw/nwjs\ Framework.framework/nwjs\ Framework',
646+
'-Wl,-force_load <(V8_BASE)',
647+
'-Wl,-force_load <(V8_PLTFRM)',
648+
],
649+
},
650+
'postbuilds': [
651+
{
652+
'postbuild_name': 'Fix iculib Link',
653+
'action': [
654+
'install_name_tool',
655+
'-change',
656+
'/usr/local/lib/libicuuc.dylib',
657+
'@rpath/libicuuc.dylib',
658+
'${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
659+
],
660+
},
661+
{
662+
'postbuild_name': 'Fix iculib Link2',
663+
'action': [
664+
'install_name_tool',
665+
'-change',
666+
'/usr/local/lib/libicui18n.dylib',
667+
'@rpath/libicui18n.dylib',
668+
'${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
669+
],
670+
},
671+
],
672+
}],
673+
[ 'OS=="mac" and component != "shared_library"', {
640674
'xcode_settings': {
641675
'OTHER_LDFLAGS': [
642676
#'-L<(PRODUCT_DIR)/../nw/', '-lv8',
@@ -948,7 +982,7 @@
948982
'target_name': 'cctest',
949983
'type': 'executable',
950984
'dependencies': [
951-
'../../testing/gtest.gyp:gtest',
985+
#'../../testing/gtest.gyp:gtest',
952986
'../../v8/src/v8.gyp:v8',
953987
'../../v8/src/v8.gyp:v8_libplatform'
954988
],

0 commit comments

Comments
 (0)