mirror of
https://github.com/logos-messaging/nim-ffi.git
synced 2026-05-06 02:09:30 +00:00
fix: add install_name for mac
not to hardcode the paths
This commit is contained in:
parent
c2c03f1f0f
commit
418cec8cc2
@ -30,7 +30,14 @@ macro declareLibrary*(libraryName: static[string]): untyped =
|
||||
nnkExprColonExpr.newTree(ident"passl", newStrLitNode(soName))
|
||||
)
|
||||
)
|
||||
|
||||
elif defined(macosx):
|
||||
## Generates {.passl: "-install_name @rpath/libwaku.dylib".}
|
||||
let installName = fmt"-install_name @rpath/lib{libraryName}.dylib"
|
||||
res.add(
|
||||
newNimNode(nnkPragma).add(
|
||||
nnkExprColonExpr.newTree(ident"passl", newStrLitNode(installName))
|
||||
)
|
||||
)
|
||||
## proc lib{libraryName}NimMain() {.importc.}
|
||||
let libNimMainName = ident(fmt"lib{libraryName}NimMain")
|
||||
let importcPragma = nnkPragma.newTree(ident"importc")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user