git.delta.rocks / jrsonnet / refs/commits / ca4a5e06ae1a

difftreelog

fix `.so` build instructions update I'm working with jrsonnet as a C lib and only managed to build it like this. Works great now! Also added instructions to cross-build on MacOS if someone wondered how

Julien Duchesne2023-05-05parent: #4be0ffe.patch.diff
in: master

2 files changed

modifiedbindings/Makefilediffbeforeafterboth
before · bindings/Makefile
1../target/release/libjsonnet.so:2	cargo build --release -p jsonnet34./c/libjsonnet_test_file: ./c/libjsonnet_test_file.c ../target/release/libjsonnet.so5	gcc -L../target/release/ -ljsonnet ./c/libjsonnet_test_file.c -o ./c/libjsonnet_test_file67.PHONY: test-c8test-c: ./c/libjsonnet_test_file ../target/release/libjsonnet.so9	export LD_LIBRARY_PATH=../target/release/10	ldd ./c/libjsonnet_test_file11	valgrind --leak-check=full ./c/libjsonnet_test_file test.jsonnet1213../target/wasm32-wasi/release/jsonnet.wasm:14	cd jsonnet && cargo wasi build --release -p jsonnet && cd ..1516test-js: ../target/wasm32-wasi/release/jsonnet.wasm17	node --experimental-wasi-unstable-preview1 --experimental-wasm-bigint js/index
modifiedbindings/README.mddiffbeforeafterboth
--- a/bindings/README.md
+++ b/bindings/README.md
@@ -5,3 +5,12 @@
 Headers are described in `c/libjsonnet.h`, this file is exact copy from `C` implementation of jsonnet, plus additional jrsonnet-specific methods
 
 Bindings should work as drop-in replacement for standard impl
+
+## Building Linux .so library on MacOS
+
+You can use `cross-rs` to do so:
+
+```console
+cargo install cross --git https://github.com/cross-rs/cross
+cross build --release -p libjsonnet --target x86_64-unknown-linux-gnu
+```