Skip to content

Commit

Permalink
fix(build): make addon buildable as static library (#119)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
addaleax authored Apr 6, 2021
1 parent 880ae2e commit 786e7d8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
'targets': [
{
'target_name': 'kerberos',
'type': 'loadable_module',
'include_dirs': [ '<!(node -e "require(\'nan\')")' ],
'sources': [
'src/kerberos.cc'
Expand All @@ -25,7 +26,16 @@
'-lkrb5',
'-lgssapi_krb5'
]
}
},
'conditions': [
['_type=="static_library"', {
'link_settings': {
'libraries': [
'-lcom_err'
]
}
}]
]
}],
['OS=="win"', {
'sources': [
Expand All @@ -34,9 +44,9 @@
],
'link_settings': {
'libraries': [
'crypt32.lib',
'secur32.lib',
'Shlwapi.lib'
'-lcrypt32',
'-lsecur32',
'-lShlwapi'
]
}
}]
Expand Down

0 comments on commit 786e7d8

Please sign in to comment.