native "<target>" "<path>" in a package's package.ludic; the compiler records the libraries of every package a program imports and writes them into the IR (; ludic-native:), so ludicc -o, ludic build, ludic test and ludic bundle all link one list. macOS: an rpath to the package and to Contents/Frameworks, where ludic bundle copies and signs each library and drops the build machine's rpath. Windows: the import library, the .dll copied beside the exe (--natives-out for the bundle). tools/native/lib.sh builds from a pinned, checksummed source with clang on both machines; ludic.nativeecho is the worked example; the shim rules are in packages/README.md. Linked at build time rather than dlopen (docs/PACKAGES.md says why). Reseeded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 lines
426 B
Text
8 lines
426 B
Text
# ludic.nativeecho - the worked example of a package that carries a native library (phase 15):
|
|
# a C function that sums a float slice, and one that records what a callback would have said
|
|
# into a buffer the package drains. Uses ludic.base and nothing else.
|
|
package "ludic.nativeecho"
|
|
version "0.1.0"
|
|
kind source
|
|
native "macos-arm64" "lib/macos-arm64/libnativeecho.dylib"
|
|
native "windows-x64" "lib/windows-x64/nativeecho.dll"
|