3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-26 00:00:55 +01:00

Fix native compile as libdeflate moved to CMake

Fixes #890 correctly. Also rebuild the compression/encryption natives on macOS and Linux ARM64.
Dieser Commit ist enthalten in:
Andrew Steinborn 2023-01-01 11:45:47 -05:00
Ursprung ef7ad150c2
Commit f62768be9a
5 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -13,13 +13,13 @@ fi
echo "Compiling libdeflate..." echo "Compiling libdeflate..."
cd libdeflate || exit cd libdeflate || exit
CFLAGS="-fPIC -O2 -fomit-frame-pointer" make cmake -B build && cmake --build build --target libdeflate_static
cd .. cd ..
CFLAGS="-O2 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/ -fPIC -shared -Wl,-z,noexecstack -Wall -Werror -fomit-frame-pointer" CFLAGS="-O2 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/ -fPIC -shared -Wl,-z,noexecstack -Wall -Werror -fomit-frame-pointer"
ARCH=$(uname -m) ARCH=$(uname -m)
mkdir -p src/main/resources/linux_$ARCH mkdir -p src/main/resources/linux_$ARCH
$CC $CFLAGS -Ilibdeflate src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \ $CC $CFLAGS -Ilibdeflate src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \
libdeflate/libdeflate.a -o src/main/resources/linux_$ARCH/velocity-compress.so libdeflate/build/libdeflate.a -o src/main/resources/linux_$ARCH/velocity-compress.so
$CC $CFLAGS -shared src/main/c/jni_util.c src/main/c/jni_cipher_openssl.c \ $CC $CFLAGS -shared src/main/c/jni_util.c src/main/c/jni_cipher_openssl.c \
-o src/main/resources/linux_$ARCH/velocity-cipher.so -lcrypto -o src/main/resources/linux_$ARCH/velocity-cipher.so -lcrypto

Datei anzeigen

@ -11,13 +11,13 @@ fi
echo "Compiling libdeflate..." echo "Compiling libdeflate..."
cd libdeflate || exit cd libdeflate || exit
CFLAGS="-fPIC -O2 -fomit-frame-pointer" make cmake -B build && cmake --build build --target libdeflate_static
cd .. cd ..
CFLAGS="-O2 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin/ -fPIC -shared -Wall -Werror -fomit-frame-pointer" CFLAGS="-O2 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin/ -fPIC -shared -Wall -Werror -fomit-frame-pointer"
ARCH=$(uname -m) ARCH=$(uname -m)
mkdir -p src/main/resources/macos_$ARCH mkdir -p src/main/resources/macos_$ARCH
$CC $CFLAGS -Ilibdeflate src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \ $CC $CFLAGS -Ilibdeflate src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \
libdeflate/libdeflate.a -o src/main/resources/macos_$ARCH/velocity-compress.dylib libdeflate/build/libdeflate.a -o src/main/resources/macos_$ARCH/velocity-compress.dylib
$CC $CFLAGS -shared src/main/c/jni_util.c src/main/c/jni_cipher_macos.c \ $CC $CFLAGS -shared src/main/c/jni_util.c src/main/c/jni_cipher_macos.c \
-o src/main/resources/macos_$ARCH/velocity-cipher.dylib -lSystem -o src/main/resources/macos_$ARCH/velocity-cipher.dylib -lSystem