diff options
Diffstat (limited to 'src/cargo-meson.sh')
| -rwxr-xr-x | src/cargo-meson.sh | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/cargo-meson.sh b/src/cargo-meson.sh index 3998db0435..75f3cd1265 100755 --- a/src/cargo-meson.sh +++ b/src/cargo-meson.sh @@ -19,6 +19,18 @@ do esac done +case "$(cargo -vV | sed -n 's/^host: \(.*\)$/\1/p')" in + *-windows-msvc) + LIBNAME=gitcore.lib + PATH="$(echo "$PATH" | tr ':' '\n' | grep -Ev "^(/mingw64/bin|/usr/bin)$" | paste -sd: -):/mingw64/bin:/usr/bin" + export PATH + ;; + *-windows-*) + LIBNAME=gitcore.lib;; + *) + LIBNAME=libgitcore.a;; +esac + cargo build --lib --quiet --manifest-path="$SOURCE_DIR/Cargo.toml" --target-dir="$BUILD_DIR" "$@" RET=$? if test $RET -ne 0 @@ -26,13 +38,6 @@ then exit $RET fi -case "$(cargo -vV | sed -s 's/^host: \(.*\)$/\1/')" in - *-windows-*) - LIBNAME=gitcore.lib;; - *) - LIBNAME=libgitcore.a;; -esac - if ! cmp "$BUILD_DIR/$BUILD_TYPE/$LIBNAME" "$BUILD_DIR/libgitcore.a" >/dev/null 2>&1 then cp "$BUILD_DIR/$BUILD_TYPE/$LIBNAME" "$BUILD_DIR/libgitcore.a" |
