Skip to content

Commit 786e7d8

Browse files
authored
fix(build): make addon buildable as static library (#119)
Require libcom_err when building a static library because the code accesses `error_message()` which comes from it. Use `-l` prefix for included libs for Windows
1 parent 880ae2e commit 786e7d8

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

binding.gyp

+14-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
'targets': [
33
{
44
'target_name': 'kerberos',
5+
'type': 'loadable_module',
56
'include_dirs': [ '<!(node -e "require(\'nan\')")' ],
67
'sources': [
78
'src/kerberos.cc'
@@ -25,7 +26,16 @@
2526
'-lkrb5',
2627
'-lgssapi_krb5'
2728
]
28-
}
29+
},
30+
'conditions': [
31+
['_type=="static_library"', {
32+
'link_settings': {
33+
'libraries': [
34+
'-lcom_err'
35+
]
36+
}
37+
}]
38+
]
2939
}],
3040
['OS=="win"', {
3141
'sources': [
@@ -34,9 +44,9 @@
3444
],
3545
'link_settings': {
3646
'libraries': [
37-
'crypt32.lib',
38-
'secur32.lib',
39-
'Shlwapi.lib'
47+
'-lcrypt32',
48+
'-lsecur32',
49+
'-lShlwapi'
4050
]
4151
}
4252
}]

0 commit comments

Comments
 (0)