extism / cpp-sdk

Extism C++ Host SDK
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

feat: static libextism-cpp / pkg-config #4

Closed G4Vi closed 8 months ago

G4Vi commented 8 months ago

The Extism cpp host sdk may now be linked with its deps (except for system deps) statically.

pkg-config --static --libs extism-cpp-static
-L/usr/local/lib -l:libextism-cpp.a -l:libjsoncpp.a -l:libextism.a -lm
g++ -o example example.cpp `pkg-config --static --libs extism-cpp-static`
ldd example
        linux-vdso.so.1 (0x00007ffc54dcd000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007efc59000000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007efc59319000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007efc592f9000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007efc58c00000)
        /lib64/ld-linux-x86-64.so.2 (0x00007efc5aba2000)

README.md is updated with linking instructions.