summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xinstaller-downloader/build.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/installer-downloader/build.sh b/installer-downloader/build.sh
index ea0f75d6c2..5e69a1eb81 100755
--- a/installer-downloader/build.sh
+++ b/installer-downloader/build.sh
@@ -100,8 +100,13 @@ function build_executable {
# Old bash versions complain about empty array expansion when -u is set
set +u
- RUSTFLAGS="-C codegen-units=1 -C panic=abort -C strip=symbols -C opt-level=z" \
- cargo build --bin installer-downloader --release "${target_args[@]}"
+ local rustflags="-C codegen-units=1 -C panic=abort -C strip=symbols -C opt-level=z"
+
+ if [[ -z "$1" && "$(uname -s)" == "MINGW"* ]] || [[ $1 == *"windows"* ]]; then
+ rustflags+=" -Ctarget-feature=+crt-static"
+ fi
+
+ RUSTFLAGS="$rustflags" cargo build --bin installer-downloader --release "${target_args[@]}"
set -u
}