From 2a25a8e084429f3ac8b706f2c22febb274ae9931 Mon Sep 17 00:00:00 2001 From: Alex Hayton Date: Tue, 30 Jul 2024 14:32:19 +0100 Subject: [PATCH] Again --- .github/workflows/examples.yml | 4 +--- scripts/set-windows-msvc.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 scripts/set-windows-msvc.sh diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 976cd236..7cec64b7 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -30,9 +30,7 @@ jobs: uses: actions/checkout@v2 - name: Set MSVC target (windows only) if: matrix.os == 'windows-latest' - run: | - echo "[build]" > .cargo/config - echo "target = "x86_64-pc-windows-msvc" >> .cargo/config + run: bash ./scripts/set-windows-msvc.sh - name: Build example working-directory: examples/${{ matrix.example }} run: cargo build diff --git a/scripts/set-windows-msvc.sh b/scripts/set-windows-msvc.sh new file mode 100644 index 00000000..37d7d7c5 --- /dev/null +++ b/scripts/set-windows-msvc.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Create a .cargo directory if it does not exist +mkdir -p .cargo + +# Create a config file with the target set to x86_64-pc-windows-msvc +echo "[build]" > .cargo/config +echo "target = "x86_64-pc-windows-msvc" >> .cargo/config \ No newline at end of file