mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-03-27 06:33:08 +00:00
The dynlib pragma hard-coded a library path and resolved it via dlopen() at
runtime, preventing static linking and forcing a specific load-time path.
Using bare {.importc.} lets consumers choose: link liblibchat dynamically
at link time (--passL:-llibchat) or link it statically into their binary.
22 lines
486 B
Nim
22 lines
486 B
Nim
# Package
|
|
|
|
version = "0.1.0"
|
|
author = "libchat"
|
|
description = "Nim Bindings for LibChat"
|
|
license = "MIT"
|
|
srcDir = "src"
|
|
bin = @["libchat"]
|
|
|
|
|
|
# Dependencies
|
|
|
|
requires "nim >= 2.2.4"
|
|
requires "results"
|
|
|
|
# Build Rust library before compiling Nim
|
|
before build:
|
|
exec "cargo build --release --manifest-path ../Cargo.toml"
|
|
|
|
task pingpong, "Run pingpong example":
|
|
exec "nim c -r --path:src --passL:../target/release/liblibchat.a examples/pingpong.nim"
|