codemp-sublime/build.sh
Camillo Schenone 0062c292a8 fix: cleaned up build script, version bumps
Former-commit-id: 30e5f85a3e0bf9c4fbb3521b287043b6f55e76a6
2024-03-16 15:51:49 +01:00

18 lines
534 B
Bash
Executable file

#!/bin/sh
ROOT_DIR="$(pwd)"
BUILD_DIR="$ROOT_DIR/target/debug/deps"
FILENAME="libcodemp_client"
TARGET_DIR="$ROOT_DIR/bindings"
TARGET_NAME="codemp_client"
PYO3_PYTHON="$(pyenv which python)"
TARGET_EXT="$($PYO3_PYTHON -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))')"
FULL_TARGET="${TARGET_NAME}${TARGET_EXT}"
echo "Building with python: $PYO3_PYTHON"
env PYO3_PYTHON="${PYO3_PYTHON}" cargo build
echo "Copying into: $TARGET_DIR/$FULL_TARGET"
ditto "$BUILD_DIR/${FILENAME}.dylib" "$TARGET_DIR/$FULL_TARGET"