From cc778e921562e98580522909a593aee3133ec81a Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 28 Apr 2016 10:36:05 +0200 Subject: [PATCH] Override BUILDING_UV_SHARED, BUILDING_V8_SHARED. We were inheriting BUILDING_UV_SHARED and BUILDING_V8_SHARED from the common.gypi from the node.js source tree. Override them with USING_UV_SHARED and USING_V8_SHARED so symbols get tagged with `__declspec(dllimport)` instead of `__declspec(dllexport)`, which is the desired attribute when building add-ons. Fixes: https://github.com/nodejs/node-gyp/issues/914 PR-URL: https://github.com/nodejs/node-gyp/pull/915 Reviewed-By: Benjamin Byholm Reviewed-By: Fedor Indutny --- addon.gypi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addon.gypi b/addon.gypi index 118ff22769..3be0f591bd 100644 --- a/addon.gypi +++ b/addon.gypi @@ -10,8 +10,14 @@ '<(node_root_dir)/deps/uv/include', '<(node_root_dir)/deps/v8/include' ], + 'defines!': [ + 'BUILDING_UV_SHARED=1', # Inherited from common.gypi. + 'BUILDING_V8_SHARED=1', # Inherited from common.gypi. + ], 'defines': [ 'NODE_GYP_MODULE_NAME=>(_target_name)', + 'USING_UV_SHARED=1', + 'USING_V8_SHARED=1', # Warn when using deprecated V8 APIs. 'V8_DEPRECATION_WARNINGS=1' ],