summaryrefslogtreecommitdiff
path: root/.github/scripts/build-pfunit-windows.sh
blob: 90504e01aaf68f7f7d6cfc2e72c2f3c4b4ef9385 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -ne 2 ]; then
  echo "Usage: build-pfunit-windows.sh TAG PREFIX" >&2
  exit 2
fi

tag="$1"
prefix="$2"

git config --global core.longpaths true
git clone --depth 1 --branch "$tag" --recursive \
  https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git pfunit-src
cmake -S pfunit-src -B pfunit-build -G "MSYS Makefiles" \
  -DSKIP_MPI=YES \
  -DSKIP_OPENMP=YES \
  -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
  -DCMAKE_INSTALL_PREFIX="$prefix"
cmake --build pfunit-build -j"$(nproc)"
cmake --install pfunit-build