node-gyp/addon.gypi
Nathan Rajlich 5c3eb824aa addon.gypi: make the -install_name use "@loader_path"
This seems more appropriate for how node native addons are build, such that
you don't actually know where the addon will reside when installed. Before,
addons would get "/usr/local/lib/binding.node" hard-coded into their load-path
and that is just plain wrong.

Still need to look into if this is necessary for other Unix platforms than OS X.
2012-10-04 12:28:46 -07:00

35 lines
1,014 B
Python

{
'target_defaults': {
'type': 'loadable_module',
'product_prefix': '',
'include_dirs': [
'<(node_root_dir)/src',
'<(node_root_dir)/deps/uv/include',
'<(node_root_dir)/deps/v8/include'
],
'target_conditions': [
['_type=="loadable_module"', {
'product_extension': 'node',
}]
],
'conditions': [
[ 'OS=="mac"', {
'libraries': [ '-undefined dynamic_lookup' ],
'xcode_settings': {
'DYLIB_INSTALL_NAME_BASE': '@loader_path'
},
}],
[ 'OS=="win"', {
'libraries': [ '-l<(node_root_dir)/$(Configuration)/node.lib' ],
# warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>'
# needs to have dll-interface to be used by clients of class 'node::ObjectWrap'
'msvs_disabled_warnings': [ 4251 ],
}],
[ 'OS=="freebsd" or OS=="openbsd" or OS=="solaris" or (OS=="linux" and target_arch!="ia32")', {
'cflags': [ '-fPIC' ],
}]
]
}
}