Workaround for nim file output issue + add compilation of static whisper example

This commit is contained in:
kdeme 2019-11-26 16:09:58 +01:00
parent 05a5c3f40b
commit c2105d0ed7
No known key found for this signature in database
GPG Key ID: 4E8DD21420AF43F5
1 changed files with 4 additions and 1 deletions

View File

@ -93,11 +93,14 @@ wrappers: | build deps libnimbus.so go-checks
libnimbus.a: | build deps
echo -e $(BUILD_MSG) "build/$@" && \
rm -f build/$@ && \
$(ENV_SCRIPT) nim c --app:staticlib --noMain --nimcache:nimcache/libnimbus $(NIM_PARAMS) -o:build/$@ wrappers/libnimbus.nim
$(ENV_SCRIPT) nim c --app:staticlib --noMain --nimcache:nimcache/libnimbus $(NIM_PARAMS) wrappers/libnimbus.nim && \
mv libnimbus build/$@ # workaround for https://github.com/nim-lang/Nim/issues/12745
wrappers-static: | build deps libnimbus.a go-checks
echo -e $(BUILD_MSG) "build/C_wrapper_example_static" && \
$(CC) wrappers/wrapper_example.c -static -pthread -Lbuild -lnimbus -lm -ldl -lpcre -g -o build/C_wrapper_example_static
echo -e $(BUILD_MSG) "build/go_wrapper_example_static" && \
go build -ldflags "-linkmode external -extldflags '-static -ldl -lpcre'" -o build/go_wrapper_example_static wrappers/wrapper_example.go wrappers/cfuncs.go
echo -e $(BUILD_MSG) "build/go_wrapper_whisper_example_static" && \
go build -ldflags "-linkmode external -extldflags '-static -ldl -lpcre'" -o build/go_wrapper_whisper_example_static wrappers/wrapper_example.go wrappers/cfuncs.go