Skip to content

Instantly share code, notes, and snippets.

@danbev
Last active March 17, 2017 05:26
Show Gist options
  • Save danbev/9a4f093beb812e42ab7fbc906f879bb5 to your computer and use it in GitHub Desktop.
Save danbev/9a4f093beb812e42ab7fbc906f879bb5 to your computer and use it in GitHub Desktop.
obj-patch
diff --git a/common.gypi b/common.gypi
index 147cc70..b84c54c 100644
--- a/common.gypi
+++ b/common.gypi
@@ -38,21 +38,31 @@
['OS == "win"', {
'os_posix': 0,
'v8_postmortem_support%': 'false',
+ 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
+ 'OBJ_PATH': '<(PRODUCT_DIR)/obj/node',
+ 'OBJ_GEN_PATH': '<(PRODUCT_DIR)/obj',
+ 'V8_BASE': '<(PRODUCT_DIR)/lib/v8_libbase.lib',
}, {
'os_posix': 1,
'v8_postmortem_support%': 'true',
}],
['OS== "mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
+ 'OBJ_PATH': '<(PRODUCT_DIR)/obj.target/node/src',
+ 'OBJ_GEN_PATH': '<(PRODUCT_DIR)/obj.target/node/gen',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
}, {
'conditions': [
['GENERATOR=="ninja"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
+ 'OBJ_PATH': '<(PRODUCT_DIR)/obj/node/src',
+ 'OBJ_GEN_PATH': '<(PRODUCT_DIR)/obj/node/gen',
'V8_BASE': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
}, {
- 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
- 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
+ 'OBJ_DIR%': '<(PRODUCT_DIR)/obj.target',
+ 'OBJ_PATH%': '<(PRODUCT_DIR)/obj.target/node/src',
+ 'OBJ_GEN_PATH%': '<(PRODUCT_DIR)/obj.target/node/gen',
+ 'V8_BASE%': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
}],
],
}],
diff --git a/node.gyp b/node.gyp
index 66fc1e9..2bcaece 100644
--- a/node.gyp
+++ b/node.gyp
@@ -20,6 +20,7 @@
'node_v8_options%': '',
'node_enable_v8_vtunejit%': 'false',
'node_core_target_name%': 'node',
+ 'obj_suffix': 'o',
'library_files': [
'lib/internal/bootstrap_node.js',
'lib/_debug_agent.js',
@@ -133,6 +134,9 @@
}, {
'use_openssl_def': 0,
}],
+ [ 'OS=="win"' , {
+ 'obj_suffix': 'obj',
+ }],
],
},
@@ -457,10 +461,10 @@
{
'action_name': 'node_dtrace_provider_o',
'inputs': [
- '<(OBJ_DIR)/node/src/node_dtrace.o',
+ '<(OBJ_PATH)/node_dtrace.o',
],
'outputs': [
- '<(OBJ_DIR)/node/src/node_dtrace_provider.o'
+ '<(OBJ_PATH)/node_dtrace_provider.o'
],
'action': [ 'dtrace', '-G', '-xnolibs', '-s', 'src/node_provider.d',
'<@(_inputs)', '-o', '<@(_outputs)' ]
@@ -510,7 +514,7 @@
'<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
],
'outputs': [
- '<(OBJ_DIR)/node/src/node_dtrace_ustack.o'
+ '<(OBJ_PATH)/node_dtrace_ustack.o'
],
'conditions': [
[ 'target_arch=="ia32"', {
@@ -584,24 +588,24 @@
],
'libraries': [
- '<(OBJ_DIR)/node/gen/node_javascript.o',
- '<(OBJ_DIR)/node/src/node_debug_options.o',
- '<(OBJ_DIR)/node/src/async-wrap.o',
- '<(OBJ_DIR)/node/src/env.o',
- '<(OBJ_DIR)/node/src/node.o',
- '<(OBJ_DIR)/node/src/node_buffer.o',
- '<(OBJ_DIR)/node/src/node_i18n.o',
- '<(OBJ_DIR)/node/src/debug-agent.o',
- '<(OBJ_DIR)/node/src/util.o',
- '<(OBJ_DIR)/node/src/string_bytes.o',
- '<(OBJ_DIR)/node/src/string_search.o',
- '<(OBJ_DIR)/node/src/stream_base.o',
- '<(OBJ_DIR)/node/src/node_constants.o',
- '<(OBJ_DIR)/node/src/node_revert.o',
- '<(OBJ_DIR)/node/src/tracing/agent.o',
- '<(OBJ_DIR)/node/src/tracing/node_trace_buffer.o',
- '<(OBJ_DIR)/node/src/tracing/node_trace_writer.o',
- '<(OBJ_DIR)/node/src/tracing/trace_event.o',
+ '<(OBJ_GEN_PATH)/node_javascript.<(obj_suffix)',
+ '<(OBJ_PATH)/node_debug_options.<(obj_suffix)',
+ '<(OBJ_PATH)/async-wrap.<(obj_suffix)',
+ '<(OBJ_PATH)/env.<(obj_suffix)',
+ '<(OBJ_PATH)/node.<(obj_suffix)',
+ '<(OBJ_PATH)/node_buffer.<(obj_suffix)',
+ '<(OBJ_PATH)/node_i18n.<(obj_suffix)',
+ '<(OBJ_PATH)/debug-agent.<(obj_suffix)',
+ '<(OBJ_PATH)/util.<(obj_suffix)',
+ '<(OBJ_PATH)/string_bytes.<(obj_suffix)',
+ '<(OBJ_PATH)/string_search.<(obj_suffix)',
+ '<(OBJ_PATH)/stream_base.<(obj_suffix)',
+ '<(OBJ_PATH)/node_constants.<(obj_suffix)',
+ '<(OBJ_PATH)/node_revert.<(obj_suffix)',
+ '<(OBJ_PATH)/tracing/agent.<(obj_suffix)',
+ '<(OBJ_PATH)/tracing/node_trace_buffer.<(obj_suffix)',
+ '<(OBJ_PATH)/tracing/node_trace_writer.<(obj_suffix)',
+ '<(OBJ_PATH)/tracing/trace_event.<(obj_suffix)',
],
'defines': [
@@ -662,9 +666,9 @@
'copies': [{
'destination': '<(OBJ_DIR)/cctest/src',
'files': [
- '<(OBJ_DIR)/node/src/node_dtrace_ustack.o',
- '<(OBJ_DIR)/node/src/node_dtrace_provider.o',
- '<(OBJ_DIR)/node/src/node_dtrace.o',
+ '<(OBJ_PATH)/node_dtrace_ustack.<(obj_suffix)',
+ '<(OBJ_PATH)/node_dtrace_provider.<(obj_suffix)',
+ '<(OBJ_PATH)/node_dtrace.<(obj_suffix)',
]},
],
}],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment