Skip to content

Commit

Permalink
Update build script for cargo workspace
Browse files Browse the repository at this point in the history
- closes #215
  • Loading branch information
cmyr committed Jul 5, 2018
1 parent ea87386 commit 27a614a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions build-rust-xcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ set -e

function build_target () {
TARGET_NAME="$1"
cd "${SRCROOT}/xi-editor/$2"
CARGO_PROJECT_FLAG="$2"
cd "${SRCROOT}/xi-editor/rust"
if [[ ${ACTION:-build} = "build" ]]; then
if [[ $PLATFORM_NAME = "" ]]; then
# default for building with xcodebuild
Expand Down Expand Up @@ -58,7 +59,7 @@ function build_target () {
if [[ $RUST_ARCH = "arm64" ]]; then
RUST_ARCH="aarch64"
fi
cargo build $RUST_CONFIGURATION_FLAG --target "${RUST_ARCH}-apple-${RUST_TARGET_OS}"
cargo build $RUST_CONFIGURATION_FLAG $CARGO_PROJECT_FLAG --target "${RUST_ARCH}-apple-${RUST_TARGET_OS}"
EXECUTABLES+=("target/${RUST_ARCH}-apple-${RUST_TARGET_OS}/${RUST_CONFIGURATION}/${TARGET_NAME}")
done

Expand All @@ -70,8 +71,8 @@ function build_target () {
fi
}

build_target xi-core rust
build_target xi-syntect-plugin rust/syntect-plugin
build_target xi-core ""
build_target xi-syntect-plugin "-p xi-syntect-plugin"

# move syntect plugin into plugins dir
mkdir -p "${BUILT_PRODUCTS_DIR}/plugins/syntect/bin"
Expand Down

0 comments on commit 27a614a

Please sign in to comment.