interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / src / cargo-meson.sh

44 lines · 868 bytes Raw Blame History
1#!/bin/sh
2
3if test "$#" -lt 2
4then
5 exit 1
6fi
7
8SOURCE_DIR="$1"
9BUILD_DIR="$2"
10BUILD_TYPE=debug
11
12shift 2
13
14for arg
15do
16 case "$arg" in
17 --release)
18 BUILD_TYPE=release;;
19 esac
20done
21
22case "$(cargo -vV | sed -n 's/^host: \(.*\)$/\1/p')" in
23 *-windows-msvc)
24 LIBNAME=gitcore.lib
25 PATH="$(echo "$PATH" | tr ':' '\n' | grep -Ev "^(/mingw64/bin|/usr/bin)$" | paste -sd: -):/mingw64/bin:/usr/bin"
26 export PATH
27 ;;
28 *-windows-*)
29 LIBNAME=gitcore.lib;;
30 *)
31 LIBNAME=libgitcore.a;;
32esac
33
34cargo build --lib --quiet --manifest-path="$SOURCE_DIR/Cargo.toml" --target-dir="$BUILD_DIR" "$@"
35RET=$?
36if test $RET -ne 0
37then
38 exit $RET
39fi
40
41if ! cmp "$BUILD_DIR/${CARGO_BUILD_TARGET:+$CARGO_BUILD_TARGET/}$BUILD_TYPE/$LIBNAME" "$BUILD_DIR/libgitcore.a" >/dev/null 2>&1
42then
43 cp "$BUILD_DIR/${CARGO_BUILD_TARGET:+$CARGO_BUILD_TARGET/}$BUILD_TYPE/$LIBNAME" "$BUILD_DIR/libgitcore.a"
44fi