diff --git a/generate_bindings.sh b/generate_bindings.sh index cc54e86..e036162 100755 --- a/generate_bindings.sh +++ b/generate_bindings.sh @@ -6,4 +6,12 @@ GEN_DIR="dotnet-tests/UniffiCS/gen" rm -rf "$GEN_DIR" mkdir -p "$GEN_DIR" -target/debug/uniffi-bindgen-cs target/debug/libuniffi_fixtures.so --library --out-dir="$GEN_DIR" --no-format +libname="" + +if [[ $(uname) == "Darwin" ]]; then + libname="libuniffi_fixtures.dylib" +else + libname="libuniffi_fixtures.so" +fi + +target/debug/uniffi-bindgen-cs "target/debug/$libname" --library --out-dir="$GEN_DIR" --no-format diff --git a/test_bindings.sh b/test_bindings.sh index ec5f7b2..2db771f 100755 --- a/test_bindings.sh +++ b/test_bindings.sh @@ -6,5 +6,10 @@ SCRIPT_DIR="${SCRIPT_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2> SOLUTION_DIR="dotnet-tests" export LD_LIBRARY_PATH="$SCRIPT_DIR/target/debug/:${LD_LIBRARY_PATH:-}" + +if [[ $(uname) == "Darwin" ]]; then + export DYLD_LIBRARY_PATH="$SCRIPT_DIR/target/debug/:${DYLD_LIBRARY_PATH:-}" +fi + cd $SOLUTION_DIR dotnet test -l "console;verbosity=normal"