fix: add install_name for mac (#8)

not to hardcode the paths
This commit is contained in:
Pablo Lopez 2026-02-20 17:37:13 +02:00 committed by GitHub
parent c2c03f1f0f
commit bb8a3e7e22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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")