fix: add install_name for mac

not to hardcode the paths
This commit is contained in:
pablo 2026-02-20 17:15:34 +02:00
parent c2c03f1f0f
commit 418cec8cc2
No known key found for this signature in database
GPG Key ID: 78F35FCC60FDC63A

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