]> git.bitcoin.ninja Git - ldk-java/commitdiff
Update genbindings.sh somewhat for newer upstream
authorMatt Corallo <git@bluematt.me>
Fri, 2 Oct 2020 20:54:35 +0000 (16:54 -0400)
committerMatt Corallo <git@bluematt.me>
Fri, 2 Oct 2020 20:54:35 +0000 (16:54 -0400)
genbindings.sh

index ddd0ed010d8046c87c570761bd4d4ffb6d333bb9..ab04c9cefd4da1a6b92952e151b4d8dc46e1c87f 100755 (executable)
@@ -12,8 +12,9 @@ set -e
 ./genbindings.py "$1/lightning-c-bindings/include/lightning.h" src/main/java/org/ldk/impl/bindings.java src/main/jni/bindings.c $3
 javac -h src/main/jni src/main/java/org/ldk/impl/bindings.java
 rm src/main/java/org/ldk/impl/bindings*.class
+COMPILE="clang -std=c11 -Wall -Wno-unused-function -Wl,--no-undefined -pthread -ldl -o liblightningjni.so -shared -fPIC -Wno-pointer-sign -Isrc/main/jni"
 if [ "$3" = "true" ]; then
-       clang -std=c11 -Wall -Wno-unused-function -g -pthread -ldl -fsanitize=address -o liblightningjni.so -shared -fPIC -Wno-pointer-sign -Isrc/main/jni -I"$1/lightning-c-bindings/include/" $2 src/main/jni/bindings.c "$1"/target/debug/liblightning.a
+       $COMPILE -g -fsanitize=address -shared-libasan -I"$1"/lightning-c-bindings/include/ $2 src/main/jni/bindings.c "$1"/lightning-c-bindings/target/debug/libldk.a
 else
-       clang -Wall -Wno-unused-function -Wl,--no-undefined -shared-libasan -pthread -ldl -flto -fuse-ld=lld -O2 -o liblightningjni.so -shared -fPIC -Wno-pointer-sign -Isrc/main/jni -I"$1/lightning-c-bindings/include/" $2 src/main/jni/bindings.c "$1"/target/release/liblightning.a
+       $COMPILE -flto -fuse-ld=lld -O3 -I"$1"/lightning-c-bindings/include/ $2 src/main/jni/bindings.c "$1"/lightning-c-bindings/target/release/libldk.a
 fi