Skip to content

Commit

Permalink
Fix gyps for common.gypi removal in chromium repo
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Nov 11, 2016
1 parent 9737843 commit 8e9b712
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 20 deletions.
125 changes: 113 additions & 12 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
'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',
Expand All @@ -28,9 +29,10 @@
# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,

# 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,

# Don't use ICU data file (icudtl.dat) from V8, we use our own.
'icu_use_data_file_flag%': 0,
Expand All @@ -42,10 +44,11 @@
}, {
'os_posix': 1,
'v8_postmortem_support%': 'true',
'clang_dir': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts',
}],
['GENERATOR == "ninja" or OS== "mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
#'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
}, {
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
Expand All @@ -63,6 +66,16 @@
],
},

'conditions': [
[ 'clang==1 and OS != "mac"', {
'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': {
Expand All @@ -79,7 +92,82 @@
],
},
'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 Down Expand Up @@ -114,7 +202,8 @@
'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
},
},
'Release': {
'Release_Base': {
'abstract': 1,
'variables': {
'v8_enable_handle_zapping': 0,
},
Expand Down Expand Up @@ -162,7 +251,19 @@
'LinkIncremental': 1, # disable incremental linking
},
},
}
},
'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 @@ -208,7 +309,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 @@ -249,13 +350,13 @@
'_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',
],
}],
[ 'OS in "linux freebsd openbsd solaris aix"', {
'cflags': [ '-pthread', ],
'ldflags': [ '-pthread' ],
'cflags': [ '-pthread'],
'ldflags': [ '-pthread'],
}],
[ 'OS in "linux freebsd openbsd solaris android aix"', {
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
]
}],
['is_clang==1 or gcc_version>=43', {
'cflags': ['-Wno-error=unused-command-line-argument', '-Wno-error=parentheses-equality'],
#'cflags': ['-Wno-error=unused-command-line-argument', '-Wno-error=parentheses-equality'],
}],
['OS=="solaris"', {
'defines': ['__EXTENSIONS__'],
Expand Down
44 changes: 39 additions & 5 deletions node.gyp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
'variables': {
'icu_gyp_path%': '../icu/icu.gyp',
'v8_use_snapshot%': 'false',
'node_use_dtrace%': 'false',
'node_use_lttng%': 'false',
Expand All @@ -19,7 +20,7 @@
'node_shared_libuv%': 'false',
'node_use_openssl': 'true',
'node_shared_openssl': 'false',
'openssl_fips%': '',
'openssl_fips': '',
'node_v8_options%': '',
'node_enable_v8_vtunejit%': 'false',
'node_core_target_name%': 'node',
Expand Down Expand Up @@ -281,6 +282,7 @@
'BUILDING_NW_NODE=1',
'V8_SHARED',
'USING_V8_SHARED',
'V8_USE_EXTERNAL_STARTUP_DATA'
],


Expand Down Expand Up @@ -351,8 +353,8 @@
[ 'v8_enable_i18n_support==1', {
'defines': [ 'NODE_HAVE_I18N_SUPPORT=1' ],
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
'../icu/icu.gyp:icui18n',
'../icu/icu.gyp:icuuc',
],
'conditions': [
[ 'icu_small=="true"', {
Expand Down Expand Up @@ -635,7 +637,39 @@
'<(V8_PLTFRM)',
'-Wl,--no-whole-archive' ]
}],
[ 'OS=="mac"', {
[ 'OS=="mac" and component == "shared_library"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-L<(PRODUCT_DIR)/../nw/', '-lv8',
'<(PRODUCT_DIR)/../nw/nwjs\ Framework.framework/nwjs\ Framework',
'-Wl,-force_load <(V8_BASE)',
'-Wl,-force_load <(V8_PLTFRM)',
],
},
'postbuilds': [
{
'postbuild_name': 'Fix iculib Link',
'action': [
'install_name_tool',
'-change',
'/usr/local/lib/libicuuc.dylib',
'@rpath/libicuuc.dylib',
'${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
],
},
{
'postbuild_name': 'Fix iculib Link2',
'action': [
'install_name_tool',
'-change',
'/usr/local/lib/libicui18n.dylib',
'@rpath/libicui18n.dylib',
'${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
],
},
],
}],
[ 'OS=="mac" and component != "shared_library"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
#'-L<(PRODUCT_DIR)/../nw/', '-lv8',
Expand Down Expand Up @@ -946,7 +980,7 @@
'target_name': 'cctest',
'type': 'executable',
'dependencies': [
'../../testing/gtest.gyp:gtest',
#'../../testing/gtest.gyp:gtest',
'../../v8/src/v8.gyp:v8',
'../../v8/src/v8.gyp:v8_libplatform'
],
Expand Down
2 changes: 0 additions & 2 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,6 @@ void PromiseRejectCallback(PromiseRejectMessage message) {

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

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

Expand Down Expand Up @@ -4934,7 +4933,6 @@ NODE_EXTERN void g_stop_nw_instance() {
return;
struct thread_ctx_st* tls_ctx = (struct thread_ctx_st*)uv_key_get(&thread_ctx_key);
assert(tls_ctx);
v8::Isolate* isolate = v8::Isolate::GetCurrent();
bool more;
uv_timer_t quit_timer;
uv_loop_t* loop = tls_ctx->env->event_loop();
Expand Down

0 comments on commit 8e9b712

Please sign in to comment.